修改发货通知单页面

main
ljh 2024-07-06 22:34:20 +08:00
parent 1e341f201e
commit 1e684b933f
20 changed files with 737 additions and 273 deletions

View File

@ -106,4 +106,10 @@ public class Invoice : EntityTenant
[SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "仓库ID")] [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "仓库ID")]
public long? WarehouseId { get; set; } public long? WarehouseId { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnName = "State", ColumnDescription = "状态")]
public int? State { get; set; }
} }

View File

@ -67,6 +67,12 @@ public class PrintCodeDetail : EntityBase
[SugarColumn(ColumnName = "ScanCodeTime", ColumnDescription = "扫码时间")] [SugarColumn(ColumnName = "ScanCodeTime", ColumnDescription = "扫码时间")]
public DateTime? ScanCodeTime { get; set; } public DateTime? ScanCodeTime { get; set; }
/// <summary>
/// 扫码时间
/// </summary>
[SugarColumn(ColumnName = "ScanCodeName", ColumnDescription = "扫码人")]
public string? ScanCodeName { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

View File

@ -16,9 +16,15 @@ public class ReportTable : EntityTenant
/// <summary> /// <summary>
/// 业务日期 /// 业务日期
/// </summary> /// </summary>
[SugarColumn(ColumnName = "StartDate", ColumnDescription = "业务日期")] [SugarColumn(ColumnName = "StartDate", ColumnDescription = "生产开始时间")]
public DateTime? StartDate { get; set; } public DateTime? StartDate { get; set; }
/// <summary>
/// 生产结束时间
/// </summary>
[SugarColumn(ColumnName = "EndDate", ColumnDescription = "生产结束时间")]
public DateTime? EndDate { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>

View File

@ -256,6 +256,19 @@ public class UpdateInvoiceInput : InvoiceBaseInput
public List<AddMaterialListInput> TableData { get; set; } public List<AddMaterialListInput> TableData { get; set; }
} }
/// <summary>
/// 发货通知单更新状态输入参数
/// </summary>
public class UpdateInvoiceStateInput : InvoiceBaseInput
{
/// <summary>
/// 单号
/// </summary>
public virtual string? CodeNum { get; set; }
}
/// <summary> /// <summary>
/// 发货通知单主键查询输入参数 /// 发货通知单主键查询输入参数
/// </summary> /// </summary>

View File

@ -105,6 +105,7 @@ public class InvoiceService : IDynamicApiController, ITransient
public async Task<long> Add(AddInvoiceInput input) public async Task<long> Add(AddInvoiceInput input)
{ {
var entity = input.Adapt<Invoice>(); var entity = input.Adapt<Invoice>();
entity.State = 0;
await _rep.InsertAsync(entity); await _rep.InsertAsync(entity);
var id = entity.Id; var id = entity.Id;
if (input.TableData!=null&&input.TableData.Count>0) if (input.TableData!=null&&input.TableData.Count>0)
@ -159,6 +160,17 @@ public class InvoiceService : IDynamicApiController, ITransient
await _materialListService.Add(item); await _materialListService.Add(item);
} }
} }
else
{
var list = await _materialListService.ListBySourceId(input.Id);
if (list != null)
{
for (int i = 0; i < list.Count; i++)
{
await _materialListService.Delete(new DeleteMaterialListInput() { Id = list[i].Id });
}
}
}
} }
/// <summary> /// <summary>
@ -328,5 +340,27 @@ public class InvoiceService : IDynamicApiController, ITransient
{ {
return await _materialListService.ListBySourceId(id); return await _materialListService.ListBySourceId(id);
} }
/// <summary>
/// 更新发货通知单状态
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "UpdateState")]
public async Task UpdateState(UpdateInvoiceStateInput input)
{
var entity = await _rep.AsQueryable()
.Where(a => !a.IsDelete)
.Where(t=>t.CodeNum == input.CodeNum)
.FirstAsync();
if (entity == null)
{
throw Oops.Oh($"数据不存在");
}
entity.State = 1;
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
} }

View File

@ -83,6 +83,11 @@ public class PrintCodeDetailBaseInput
/// </summary> /// </summary>
public virtual DateTime? ScanCodeTime { get; set; } public virtual DateTime? ScanCodeTime { get; set; }
/// <summary>
/// 扫码人
/// </summary>
public virtual string ScanCodeName { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

View File

@ -80,11 +80,18 @@ public class PrintCodeDetailOutput
/// </summary> /// </summary>
public DateTime? PrintCodeTime { get; set; } public DateTime? PrintCodeTime { get; set; }
/// <summary> /// <summary>
/// 扫码时间 /// 扫码时间
/// </summary> /// </summary>
public DateTime? ScanCodeTime { get; set; } public DateTime? ScanCodeTime { get; set; }
/// <summary>
/// 扫码人
/// </summary>
public string? ScanCodeName { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

View File

@ -29,5 +29,10 @@ public class AddProductCodeInput
/// </summary> /// </summary>
public List<PrintData> CodeDatas { get; set; } public List<PrintData> CodeDatas { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndDt { get; set; }
} }

View File

@ -177,11 +177,14 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
if (repeatCode.ReportTableId > 0) if (repeatCode.ReportTableId > 0)
{ {
var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = repeatCode.ReportTableId ?? 0 }); var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = repeatCode.ReportTableId ?? 0 });
if (reportTable != null)
{
if (string.IsNullOrWhiteSpace(reportTable.ProductType) || reportTable.ProductType.Equals("普通生产")) if (string.IsNullOrWhiteSpace(reportTable.ProductType) || reportTable.ProductType.Equals("普通生产"))
{ {
codesToKeep.Add(repeatCode); codesToKeep.Add(repeatCode);
} }
} }
}
else else
{ {
codesToKeep.Add(repeatCode); codesToKeep.Add(repeatCode);
@ -231,6 +234,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName, CreateUserName = userName,
StartDate = DateTime.Now, StartDate = DateTime.Now,
EndDate = input.EndDt,
SourceNumber = warehousing.SourceNumber, SourceNumber = warehousing.SourceNumber,
Unit = warehousing.Unit, Unit = warehousing.Unit,
Remarks = warehousing.Remarks Remarks = warehousing.Remarks
@ -249,11 +253,11 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
var code = CodeHelper.GetCode(item.BarCode, item.QrCode); var code = CodeHelper.GetCode(item.BarCode, item.QrCode);
var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码"; var codeType = string.IsNullOrEmpty(item.BarCode) ? "二维码" : "条码";
var unit = units.Find(a => a.Name == item.PackageName); var unit = units.Find(a => a.Name == item.PackageName);
var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = reprotId });
if (reportTable.ProductType.Equals("返工生产"))
{
var upPrintCodeDetails = await _codeDetailService.GetByProductCodes(code); var upPrintCodeDetails = await _codeDetailService.GetByProductCodes(code);
foreach (var upPrintCodeDetail in upPrintCodeDetails) foreach (var upPrintCodeDetail in upPrintCodeDetails.Where(t=>t.ReportTableId== reprotId))
{
var reportTable = await _reportTableService.Detail(new QueryByIdReportTableInput { Id = upPrintCodeDetail.ReportTableId??0 });
if (reportTable.ProductType.Equals("返工生产"))
{ {
if (!upPrintCodeDetail.Code.Contains("#")) if (!upPrintCodeDetail.Code.Contains("#"))
{ {
@ -274,7 +278,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
BaseUnit = baseUnit, BaseUnit = baseUnit,
PrintCodeTime = DateTime.Now, PrintCodeTime = DateTime.Now,
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName CreateUserName = userName,
ScanCodeTime = DateTime.Now,
ScanCodeName = userName
}; };
var detailId = await _codeDetailService.Add(detail); var detailId = await _codeDetailService.Add(detail);
list.Add(detail, detailId); list.Add(detail, detailId);
@ -298,7 +304,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName, CreateUserName = userName,
FatherCode = code, FatherCode = code,
FatherId = detailId FatherId = detailId,
ScanCodeTime = DateTime.Now,
ScanCodeName = userName
}; };
var detailId2 = await _codeDetailService.Add(detail2); var detailId2 = await _codeDetailService.Add(detail2);
list.Add(detail2, detailId2); list.Add(detail2, detailId2);
@ -322,7 +330,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName, CreateUserName = userName,
FatherCode = code2, FatherCode = code2,
FatherId = detailId2 FatherId = detailId2,
ScanCodeTime = DateTime.Now,
ScanCodeName = userName
}; };
var detailId3 = await _codeDetailService.Add(detail3); var detailId3 = await _codeDetailService.Add(detail3);
list.Add(detail3, detailId3); list.Add(detail3, detailId3);
@ -347,7 +357,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName, CreateUserName = userName,
FatherCode = code3, FatherCode = code3,
FatherId = detailId3 FatherId = detailId3,
ScanCodeTime = DateTime.Now,
ScanCodeName = userName
}; };
var detailId4 = await _codeDetailService.Add(detail4); var detailId4 = await _codeDetailService.Add(detail4);
list.Add(detail4, detailId4); list.Add(detail4, detailId4);
@ -372,7 +384,9 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
CreateUserId = userId, CreateUserId = userId,
CreateUserName = userName, CreateUserName = userName,
FatherCode = code4, FatherCode = code4,
FatherId = detailId4 FatherId = detailId4,
ScanCodeTime = DateTime.Now,
ScanCodeName = userName
}; };
var detailId5 = await _codeDetailService.Add(detail5); var detailId5 = await _codeDetailService.Add(detail5);
list.Add(detail5, detailId5); list.Add(detail5, detailId5);

View File

@ -49,6 +49,17 @@ public class PrintCodeTreeData
/// </summary> /// </summary>
public string? Remarks { get; set; } public string? Remarks { get; set; }
/// <summary>
/// 扫码时间
/// </summary>
public DateTime? ScanCodeTime { get; set; }
/// <summary>
/// 扫码人
/// </summary>
public string? ScanCodeName { get; set; }
public List<PrintCodeTreeData> Children { get; set; } public List<PrintCodeTreeData> Children { get; set; }
public bool HasChildren { get; set; } = true; public bool HasChildren { get; set; } = true;
} }

View File

@ -18,6 +18,12 @@ public class ReportTableBaseInput
/// </summary> /// </summary>
public virtual DateTime? StartDate { get; set; } public virtual DateTime? StartDate { get; set; }
/// <summary>
/// 生产结束日期
/// </summary>
public virtual DateTime? EndDate { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>

View File

@ -20,6 +20,11 @@ public class ReportTableOutput
/// </summary> /// </summary>
public DateTime? StartDate { get; set; } public DateTime? StartDate { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>

View File

@ -76,6 +76,7 @@ public class ReportTableService : IDynamicApiController, ITransient
Id = u.Id, Id = u.Id,
OddNumber = u.OddNumber, OddNumber = u.OddNumber,
StartDate = u.StartDate, StartDate = u.StartDate,
EndDate = u.EndDate,
State = u.State, State = u.State,
ProductType = u.ProductType, ProductType = u.ProductType,
ProductionLine = u.ProductionLine, ProductionLine = u.ProductionLine,
@ -321,7 +322,7 @@ public class ReportTableService : IDynamicApiController, ITransient
PrintCodeTime = DateTime.Now, PrintCodeTime = DateTime.Now,
CreateUserId = userId, CreateUserId = userId,
MaterialsId = input.MaterialsId, MaterialsId = input.MaterialsId,
CreateUserName = userName CreateUserName = userName,
}; };
var detailId = await _codeDetailService.Add(detail); var detailId = await _codeDetailService.Add(detail);
var treeData1 = detail.Adapt<PrintCodeTreeData>(); var treeData1 = detail.Adapt<PrintCodeTreeData>();

View File

@ -1,28 +1,22 @@
<template> <template>
<div class="invoice-container"> <div class="invoice-container" style="height: 100vh">
<el-dialog v-model="isShowDialog" :width="860" 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" > <el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" >
<el-card class="box-card">
<el-row :gutter="35"> <el-row :gutter="35">
<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-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" 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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="业务日期" prop="startDate"> <el-form-item label="业务日期" prop="startDate">
<el-date-picker v-model="ruleForm.startDate" type="date" placeholder="业务日期" /> <el-date-picker v-model="ruleForm.startDate" 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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="业务类型" prop="businessType" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> <el-form-item label="业务类型" prop="businessType" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.businessType" placeholder="请选择" clearable> <el-select v-model="ruleForm.businessType" placeholder="请选择" clearable>
<el-option label="销售出库" value="销售出库" /> <el-option label="销售出库" value="销售出库" />
@ -30,7 +24,7 @@
</el-select> </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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="客户" prop="custom" :rules="[{ required: true, message: '客户不能为空', trigger: 'blur' }]"> <el-form-item label="客户" prop="custom" :rules="[{ required: true, message: '客户不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.custom" placeholder="请选择" clearable > <el-select v-model="ruleForm.custom" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in customs" <el-option :label="item.name" :value="item.name" v-for="item, index in customs"
@ -38,7 +32,7 @@
</el-select> </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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="仓库" prop="warehouseId" :rules="[{ required: true, message: '仓库不能为空', trigger: 'blur' }]"> <el-form-item label="仓库" prop="warehouseId" :rules="[{ required: true, message: '仓库不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.warehouseId" placeholder="请选择" clearable @change="warehouseChange"> <el-select v-model="ruleForm.warehouseId" placeholder="请选择" clearable @change="warehouseChange">
<el-option :label="item.name" :value="item.id" v-for="item, index in warehouses" <el-option :label="item.name" :value="item.id" v-for="item, index in warehouses"
@ -51,27 +45,37 @@
<el-input v-model="ruleForm.department" placeholder="请输入部门" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.department" 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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="车牌号" prop="carNumber"> <el-form-item label="车牌号" prop="carNumber">
<el-input v-model="ruleForm.carNumber" placeholder="请输入车牌号" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.carNumber" 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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="停车位" prop="parkingSpace"> <el-form-item label="停车位" prop="parkingSpace">
<el-input v-model="ruleForm.parkingSpace" placeholder="请输入停车位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.parkingSpace" 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-row>
</el-card>
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>其他信息</span>
</div>
</template>
<el-row :gutter="35">
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="业务员" prop="salesman"> <el-form-item label="业务员" prop="salesman">
<el-input v-model="ruleForm.salesman" placeholder="请输入业务员" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.salesman" 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="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="收货单位" prop="consignee"> <el-form-item label="收货单位" prop="consignee">
<el-input v-model="ruleForm.consignee" placeholder="请输入收货单位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.consignee" 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="12" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="交货日期" prop="deliveryDate"> <el-form-item label="交货日期" prop="deliveryDate">
<el-date-picker v-model="ruleForm.deliveryDate" type="date" placeholder="交货日期" /> <el-date-picker v-model="ruleForm.deliveryDate" type="date" placeholder="交货日期" />
</el-form-item> </el-form-item>
@ -86,6 +90,15 @@
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="128" show-word-limit clearable /> <el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="128" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
</el-card>
<el-card class="box-card">
<template #header>
<div class="card-header">
<span>扩展字段</span>
</div>
</template>
<el-row :gutter="35">
<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="customExpand"> <el-form-item label="方案客户拓展" prop="customExpand">
<el-input v-model="ruleForm.customExpand" placeholder="请输入方案客户拓展" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.customExpand" placeholder="请输入方案客户拓展" maxlength="32" show-word-limit clearable />
@ -97,15 +110,21 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px"> <el-card class="box-card" >
<template #header>
<div class="card-header">
<span>明细信息</span>
</div>
</template>
<el-table <el-table
:data="ruleForm.tableData" :data="ruleForm.tableData"
style="width: 100%" style="width: 100%;height: 300px;overflow-y:scroll"
v-loading="loading" v-loading="loading"
tooltip-effect="light" tooltip-effect="light"
row-key="id" row-key="id"
border=""> border=""
>
<el-table-column prop="materialsId" label="物料" width="180" align="center"> <el-table-column prop="materialsId" label="物料" width="180" align="center">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.materialsId" placeholder="请选择" autocomplete="off" controls-position="right" clearable @change="materialsChange"> <el-select v-model="scope.row.materialsId" placeholder="请选择" autocomplete="off" controls-position="right" clearable @change="materialsChange">
@ -136,24 +155,19 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="text-align: left; margin-top: 10px">
<el-button icon="ele-Plus" @click="addColumn"></el-button>
</div>
</el-card> </el-card>
<el-button icon="ele-Plus" @click="addColumn"></el-button>
<div class="footer" align="right" >
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button> <el-button type="primary" @click="submit" :disabled="props.disabled"> </el-button>
</span> </div>
</template> </el-form>
</el-dialog>
</div> </div>
</template> </template>
<style scoped> <style scoped>
.box-card{
margin-bottom: 30px;
}
:deep(.el-select), :deep(.el-select),
:deep(.el-input-number) { :deep(.el-input-number) {
width: 100%; width: 100%;
@ -178,9 +192,11 @@
type: String, type: String,
default: "", default: "",
}, },
row: Object,
disabled:Boolean,
}); });
// //
const emit = defineEmits(["reloadTable"]); const emit = defineEmits(["reloadTable","back"]);
const ruleFormRef = ref(); const ruleFormRef = ref();
const isShowDialog = ref(false); const isShowDialog = ref(false);
const ruleForm = ref<any>({}); const ruleForm = ref<any>({});
@ -200,25 +216,6 @@
// warehouse: [{required: true, message: '', trigger: 'blur',},], // warehouse: [{required: true, message: '', trigger: 'blur',},],
}); });
//
const openDialog = async (row: any) => {
// ruleForm = JSON.parse(JSON.stringify(row));
// detail
let rowData = JSON.parse(JSON.stringify(row));
if (rowData.id)
{
ruleForm.value = (await detailInvoice(rowData.id)).data.result;
ruleForm.value.tableData = (await materialListBySourceId(rowData.id)).data.result;
}
else
{
ruleForm.value = rowData;
ruleForm.value.codeNum = getCurrentDate();
}
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true;
};
// //
const closeDialog = () => { const closeDialog = () => {
@ -228,7 +225,7 @@
// //
const cancel = () => { const cancel = () => {
isShowDialog.value = false; emit("back");
}; };
// //
@ -242,7 +239,8 @@
} else { } else {
await updateInvoice(values); await updateInvoice(values);
} }
closeDialog(); emit("reloadTable");
emit("back");
} else { } else {
console.log('flase'); console.log('flase');
ElMessage({ ElMessage({
@ -271,17 +269,14 @@
// //
function addColumn() { function addColumn() {
//console.log('object'); ruleForm.value.tableData.push({
tableData.value.push({ materialsId: null,
materialsId: 0,
unit: '箱', unit: '箱',
count:1, count:1,
remarks: '', remarks: '',
sourceId:0, sourceId:0,
index: tableData.value.length+1, index: tableData.value.length+1,
}); });
ruleForm.value.tableData = tableData.value;
colIndex++; colIndex++;
} }
@ -290,6 +285,22 @@ function addColumn() {
warehouses.value = (await listWarehouse()).data.result; warehouses.value = (await listWarehouse()).data.result;
suppliers.value = (await listSupplier()).data.result; suppliers.value = (await listSupplier()).data.result;
customs.value = (await listCustom()).data.result; customs.value = (await listCustom()).data.result;
// ruleForm = JSON.parse(JSON.stringify(row));
// detail
let rowData = JSON.parse(JSON.stringify(props.row));
if (rowData?.id)
{
ruleForm.value = (await detailInvoice(rowData.id)).data.result;
ruleForm.value.tableData = (await materialListBySourceId(rowData.id)).data.result;
}
else
{
ruleForm.value = {};
ruleForm.value.codeNum = getCurrentDate();
}
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true;
}); });
const warehouseChange = async (value : any) => { const warehouseChange = async (value : any) => {
@ -301,8 +312,7 @@ function addColumn() {
function handleColDelete(index: number) { function handleColDelete(index: number) {
tableData.value.splice(index, 1); ruleForm.value.tableData.splice(index, 1);
ruleForm.value.tableData = tableData.value;
} }
// //
@ -329,8 +339,6 @@ function ChangeExForArray(index1: number, index2: number, array: Array<any>) {
return array; return array;
} }
//
defineExpose({ openDialog });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="invoice-container"> <div v-if="!state.editShow" class="invoice-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }"> <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90"> <el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row> <el-row>
@ -140,6 +140,8 @@
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" /> <el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column prop="customExpand" label="方案客户拓展" width="90" show-overflow-tooltip="" /> <el-table-column prop="customExpand" label="方案客户拓展" width="90" show-overflow-tooltip="" />
<el-table-column prop="sendOutExpand" label="发货拓展" width="140" show-overflow-tooltip="" /> <el-table-column prop="sendOutExpand" label="发货拓展" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="发货状态" width="140" show-overflow-tooltip :formatter="formatState">
</el-table-column>
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('invoice:update') || auth('invoice:delete')"> <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('invoice:update') || auth('invoice:delete')">
<template #default="scope"> <template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditInvoice(scope.row)" v-auth="'invoice:update'"> </el-button> <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditInvoice(scope.row)" v-auth="'invoice:update'"> </el-button>
@ -162,17 +164,23 @@
ref="printDialogRef" ref="printDialogRef"
:title="printInvoiceTitle" :title="printInvoiceTitle"
@reloadTable="handleQuery" /> @reloadTable="handleQuery" />
</el-card>
</div>
<div v-else class="reportDetailTable-container">
<el-card >
<editDialog <editDialog
ref="editDialogRef" ref="editDialogRef"
:title="editInvoiceTitle" :row = "state.editRow"
:disabled = "state.editDisabled"
@reloadTable="handleQuery" @reloadTable="handleQuery"
@back="close"
/> />
</el-card> </el-card>
</div> </div>
</template> </template>
<script lang="ts" setup="" name="invoice"> <script lang="ts" setup="" name="invoice">
import { ref } from "vue"; import {reactive, ref} from "vue";
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils'; import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
@ -194,6 +202,11 @@
pageSize: 10, pageSize: 10,
total: 0, total: 0,
}); });
const state = reactive({
editShow: false,
editRow:<any>{},
editDisabled:false
},)
const printInvoiceTitle = ref(""); const printInvoiceTitle = ref("");
const editInvoiceTitle = ref(""); const editInvoiceTitle = ref("");
@ -203,6 +216,15 @@
showAdvanceQueryUI.value = !showAdvanceQueryUI.value; showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
} }
const formatState = (row, column, cellValue) => {
return cellValue === 1 ? '装货中' : '未装货';
}
//
const close = () => {
state.editShow = false;
};
// //
const handleQuery = async () => { const handleQuery = async () => {
@ -222,8 +244,9 @@
// //
const openAddInvoice = () => { const openAddInvoice = () => {
editInvoiceTitle.value = '添加发货通知单'; state.editDisabled = false;
editDialogRef.value.openDialog({}); state.editRow = null;
state.editShow = true;
}; };
// //
@ -233,8 +256,9 @@
// //
const openEditInvoice = (row: any) => { const openEditInvoice = (row: any) => {
editInvoiceTitle.value = '编辑发货通知单'; state.editRow = row;
editDialogRef.value.openDialog(row); state.editShow = true;
state.editDisabled = false;
}; };
// //

View File

@ -10,7 +10,7 @@
<el-form label-width="auto" > <el-form label-width="auto" >
<el-row :gutter="35"> <el-row :gutter="35">
<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="名称" > <el-form-item label="产品名称" >
<el-select v-model="ruleReportForm.materialsId" placeholder="请选择" clearable @change="materialsChange" disabled> <el-select v-model="ruleReportForm.materialsId" placeholder="请选择" clearable @change="materialsChange" disabled>
<el-option :label="item.name" :value="item.id" v-for="item, index in materials" <el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" /> :key="index" />
@ -18,8 +18,8 @@
</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="单位"> <el-form-item label="产品编号">
<el-input v-model="ruleReportForm.unit" maxlength="32" show-word-limit clearable disabled/> <el-input v-model="ruleReportForm.codeNum" maxlength="32" show-word-limit clearable disabled/>
</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">
@ -34,8 +34,14 @@
</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="业务日期" > <el-form-item label="生产开工时间" >
<el-date-picker v-model="ruleReportForm.startDate" type="date" placeholder="生产日期" disabled/> <el-date-picker v-model="ruleReportForm.startDate" type="date" placeholder="生产开工时间" disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产结束时间" >
<el-date-picker v-model="ruleReportForm.endDate" type="date" placeholder="生产结束时间" disabled/>
</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">
@ -106,6 +112,8 @@
<el-table-column prop="baseCount" label="基本数量" width="100" show-overflow-tooltip="" /> <el-table-column prop="baseCount" label="基本数量" width="100" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="100" show-overflow-tooltip="" /> <el-table-column prop="baseUnit" label="基本单位" width="100" show-overflow-tooltip="" />
<el-table-column prop="childCount" label="子码数" width="80" show-overflow-tooltip="" /> <el-table-column prop="childCount" label="子码数" width="80" show-overflow-tooltip="" />
<el-table-column prop="scanCodeTime" label="扫描时间" width="110" show-overflow-tooltip="" />
<el-table-column prop="scanCodeName" label="提交人" width="80" show-overflow-tooltip="" />
<!-- <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" > <!-- <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" >
<template #default="scope"> <template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="''" > 查看 </el-button> <el-button icon="ele-Edit" size="small" text="" type="primary" @click="''" > 查看 </el-button>
@ -121,11 +129,23 @@
<el-input v-model="ruleReportForm.createUserName" disabled clearable /> <el-input v-model="ruleReportForm.createUserName" disabled clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="创建时间" >
<el-input v-model="ruleReportForm.createTime" disabled clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="修改人" > <el-form-item label="修改人" >
<el-input v-model="ruleReportForm.updateUserName" disabled clearable /> <el-input v-model="ruleReportForm.updateUserName" disabled clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="修改人" >
<el-input v-model="ruleReportForm.updateTime" disabled clearable />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="reportDetailTable-container" style="height: 100vh"> <div class="reportDetailTable-container" style="height: 100vh">
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules"> <el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" >
<el-row :gutter="35"> <el-row :gutter="35">
<el-form-item v-show="false"> <el-form-item v-show="false">
<el-input v-model="ruleForm.id" /> <el-input v-model="ruleForm.id" />
@ -238,12 +238,6 @@
const ruleFormRef = ref(); const ruleFormRef = ref();
const isShowDialog = ref(false); const isShowDialog = ref(false);
const ruleForm = ref<any>({}); const ruleForm = ref<any>({});
//const materials = ref<any>({});
//
const rules = ref<FormRules>({
productName: [{required: true, message: '请输入产品名称!', trigger: 'blur',},],
state: [{required: true, message: '请输入状态!', trigger: 'blur',},],
});
const materials = ref<any>([]); const materials = ref<any>([]);
const units = ref<any>([]); const units = ref<any>([]);
@ -318,6 +312,7 @@
if (isValid) { if (isValid) {
let values = ruleForm.value; let values = ruleForm.value;
if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) { if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) {
values.state="待审核";
await addReportDetailTable(values); await addReportDetailTable(values);
} else { } else {
await updateReportDetailTable(values); await updateReportDetailTable(values);

View File

@ -74,7 +74,7 @@
<el-button icon="ele-ZoomOut" @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="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> </el-button> <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> </el-button>
<el-button type="primary" style="margin-left:5px;" icon="ele-Check" @click="handleStateChange('已审核')" > 审核 </el-button> <el-button type="primary" style="margin-left:5px;" icon="ele-Check" @click="handleStateChange('已审核')" > 审核 </el-button>
<el-button type="primary" style="margin-left:5px;" icon="ele-CloseBold" @click="handleStateChange('待审核')" > 审核 </el-button> <el-button type="primary" style="margin-left:5px;" icon="ele-CloseBold" @click="handleStateChange('待审核')" > 审核 </el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -215,6 +215,7 @@ import {
// //
const openAddReportDetailTable = () => { const openAddReportDetailTable = () => {
state.editDisabled = false;
state.editRow = null; state.editRow = null;
state.editShow = true; state.editShow = true;
}; };

View File

@ -0,0 +1,266 @@
<template>
<div class="reportTable-container" style="height: 100vh">
<el-form label-width="auto" >
<el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="产品名称" >
<el-select v-model="ruleReportForm.materialsId" placeholder="请选择" clearable @change="materialsChange" disabled>
<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="产品编号">
<el-input v-model="ruleReportForm.codeNum" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="批次" prop="batch">
<el-input v-model="ruleReportForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单号">
<el-input v-model="ruleReportForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产开工时间" >
<el-date-picker v-model="ruleReportForm.startDate" type="date" placeholder="生产开工时间" disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产结束时间" >
<el-date-picker v-model="ruleReportForm.endDate" type="date" placeholder="生产结束时间" disabled/>
</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" :rules="[{ required: true, message: '生产类型不能为空', trigger: 'blur' }]">
<el-select v-model="ruleReportForm.productType" placeholder="请选择" clearable disabled>
<el-option label="普通生产" value= '普通生产' />
<el-option label="返工生产" value= '返工生产' />
</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="productionLine" >
<el-select v-model="ruleReportForm.productionLine" placeholder="请选择" clearable disabled>
<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="productCount" >
<el-input-number v-model="ruleReportForm.productCount" placeholder="请输入计划生产数量" clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="备注" prop="remarks" >
<el-input v-model="ruleReportForm.remarks" clearable disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-tabs v-model="activeName" class="demo-tabs" :key="key">
<el-tab-pane label="条码信息" name="条码信息">
<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' }"
style="width: 100%"
tooltip-effect="light"
row-key="code"
:default-expand-all="isExpandAll"
border="">
<el-table-column prop="code" label="条码" width="200" show-overflow-tooltip="" />
<el-table-column prop="fatherCode" label="上级码" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeName" label="条码类型" width="100" show-overflow-tooltip="" />
<el-table-column prop="count" label="数量" width="80" show-overflow-tooltip="" />
<el-table-column prop="unit" label="单位" width="80" show-overflow-tooltip="" />
<el-table-column prop="baseCount" label="基本数量" width="100" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="100" show-overflow-tooltip="" />
<el-table-column prop="childCount" label="子码数" width="80" show-overflow-tooltip="" />
<el-table-column prop="scanCodeTime" label="扫描时间" width="110" show-overflow-tooltip="" />
<el-table-column prop="scanCodeName" label="提交人" width="80" show-overflow-tooltip="" />
<!-- <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" >
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="''" > 查看 </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="''" > 删除 </el-button>
</template>
</el-table-column> -->
</el-table>
</el-tab-pane>
<el-tab-pane label="操作信息" name="操作信息">
<el-row>
<el-col :span="8">
<el-form-item label="创建人" >
<el-input v-model="ruleReportForm.createUserName" disabled clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" >
<el-input v-model="ruleReportForm.createTime" disabled clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="修改人" >
<el-input v-model="ruleReportForm.updateUserName" disabled clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="修改人" >
<el-input v-model="ruleReportForm.updateTime" disabled clearable />
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
<div class="footer" align="right" >
<el-button @click="cancel"> </el-button>
<!-- <el-button type="primary" @click="submit" > </el-button>-->
</div>
</div>
</template>
<style scoped>
:deep(.el-select),
:deep(.el-input-number) {
width: 100%;
}
</style>
<script lang="ts" setup>
import { ref,onMounted,reactive } from "vue";
import type { FormRules } from "element-plus";
import { getPrintDetail} from "/@/api/main/reportTable";
//
var props = defineProps({
title: {
type: String,
default: "",
},
row: Object,
disabled:Boolean,
});
const activeName = ref('条码信息')
//
const emit = defineEmits(["reloadTable"]);
const isShowDialog = ref(false);
const ruleReportForm = ref<any>([]);
const ruleForm = ref<any>([]);
const tempRuleForm = ref<any>([]);
const loading = ref(false);
const queryParams = ref<any>({});
//
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");
isShowDialog.value = false;
};
//
const cancel = () => {
emit("back");
};
//
const submit = async () => {
isShowDialog.value = false;
};
const isExpandAll = ref(false);
//
onMounted(async () => {
const row = props.row as any;
ruleForm.value=[];
if(typeof(row.id) === 'number'){
var res = await getPrintDetail(row.id);
ruleForm.value = res.data.result;
ruleReportForm.value = {...row};
}else{
ruleForm.value=row.id;
}
//console.log(ruleForm.value);
tempRuleForm.value=ruleForm.value;
});
</script>
<style scoped>
.footer {
position: fixed; /* 固定定位 */
left: 0;
bottom: 60px;
width: 100%; /* 宽度占满整个屏幕 */
color: #fff; /* 文字颜色 */
padding: 10px; /* 可根据需要添加内边距 */
text-align: right; /* 文字居中 */
}
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="reportTable-container"> <div class="reportTable-container" v-if="!state.editShow">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }"> <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90"> <el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row> <el-row>
@ -20,7 +20,8 @@
</el-col> </el-col>
<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-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" /> <el-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange"
v-model="queryParams.startDateRange"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<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">
@ -56,11 +57,18 @@
<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">
<el-form-item> <el-form-item>
<el-button-group style="display: flex; align-items: center;"> <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="handleQuery" v-auth="'reportTable:page'">
<el-button type="primary" icon="ele-Search" @click="barCodeQuery" v-auth="'reportTable:page'"> </el-button> </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-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-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI"
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> </el-button> style="margin-left:5px;"> 高级查询
</el-button>
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI"
style="margin-left:5px;"> 隐藏
</el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -89,9 +97,12 @@
<el-table-column prop="productCount" label="生产数量" width="100" show-overflow-tooltip=""/> <el-table-column prop="productCount" label="生产数量" width="100" show-overflow-tooltip=""/>
<!-- <el-table-column prop="sourceNumber" 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 prop="remarks" label="备注" width="140" show-overflow-tooltip=""/>
<el-table-column label="操作" width="200" 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"> <template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button> <el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row)"
v-auth="'reportDetailTable:update'"> 详情
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -106,25 +117,32 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
/> />
<editDialog <!-- <editDialog-->
ref="editDialogRef" <!-- ref="editDialogRef"-->
:title="editReportTableTitle" <!-- :title="editReportTableTitle"-->
@reloadTable="handleQuery" <!-- @reloadTable="handleQuery"-->
/> <!-- />-->
</el-card>
</div>
<div class="reportTable-container" v-else>
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<printDetailDialog <printDetailDialog
ref="printDetailDialogRef" ref="printDetailDialogRef"
:title="printDetailTableTitle" :title="printDetailTableTitle"
:row = "state.editRow"
@back="close"
/> />
</el-card> </el-card>
</div> </div>
</template> </template>
<script lang="ts" setup="" name="reportTable"> <script lang="ts" setup="" name="reportTable">
import { ref } from "vue"; import {reactive, ref} from "vue";
import {ElMessageBox, ElMessage} from "element-plus"; import {ElMessageBox, ElMessage} from "element-plus";
import {auth} from '/@/utils/authFunction'; import {auth} from '/@/utils/authFunction';
import printDetailDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue' import printDetailDialog from '/@/views/productionCenter/reportTable/component/codeDialog.vue'
import editDialog from '/@/views/productionCenter/reportTable/component/editDialog.vue' import editDialog from '/@/views/productionCenter/reportTable/component/editDialog.vue'
import {pageReportTable, deleteReportTable, getByCodeReportTable} from '/@/api/main/reportTable'; import {pageReportTable, deleteReportTable, getByCodeReportTable} from '/@/api/main/reportTable';
@ -143,6 +161,11 @@
const editReportTableTitle = ref(""); const editReportTableTitle = ref("");
const printDetailTableTitle = ref(""); const printDetailTableTitle = ref("");
const state = reactive({
editShow: false,
editRow:<any>{},
editDisabled:false
})
// //
const changeAdvanceQueryUI = () => { const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value; showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
@ -192,9 +215,14 @@
// //
const readReportDetailTable = (row: any) => { const readReportDetailTable = (row: any) => {
printDetailTableTitle.value = '条码详情'; state.editRow = row;
//console.log(row.sourceId); state.editShow = true;
printDetailDialogRef.value.openDialog(row); state.editDisabled = false;
};
//
const close = () => {
state.editShow = false;
}; };
// //
@ -209,7 +237,8 @@
handleQuery(); handleQuery();
ElMessage.success("删除成功"); ElMessage.success("删除成功");
}) })
.catch(() => {}); .catch(() => {
});
}; };
// //
@ -227,10 +256,12 @@
handleQuery(); handleQuery();
</script> </script>
<style scoped> <style scoped>
:deep(.el-ipnut), :deep(.el-ipnut),
:deep(.el-select), :deep(.el-select),
:deep(.el-input-number) { :deep(.el-input-number) {
width: 100%; width: 100%;
} }
</style> </style>