修改发货通知单页面

main
ljh 2024-07-09 01:45:18 +09:00
parent 3976c54e34
commit 7a1de2d58a
13 changed files with 1330 additions and 95 deletions

View File

@ -112,4 +112,10 @@ public class Invoice : EntityTenant
[SugarColumn(ColumnName = "State", ColumnDescription = "状态")]
public int? State { get; set; }
/// <summary>
/// 审核状态
/// </summary>
[SugarColumn(ColumnName = "AuditState", ColumnDescription = "状态")]
public int? AuditState { get; set; }
}

View File

@ -37,4 +37,35 @@ public class MaterialList : EntityBaseId
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
public string? Remarks { get; set; }
/// <summary>
/// 编码
/// </summary>
[SugarColumn(ColumnName = "CodeNum", ColumnDescription = "编码", Length = 32)]
public string? CodeNum { get; set; }
/// <summary>
/// 规格型号
/// </summary>
[SugarColumn(ColumnName = "Specifications", ColumnDescription = "规格型号", Length = 32)]
public string? Specifications { get; set; }
/// <summary>
/// 计划数量
/// </summary>
[SugarColumn(ColumnName = "PlanQty", ColumnDescription = "计划数量")]
public int? PlanQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[SugarColumn(ColumnName = "ShipmentQty", ColumnDescription = "发货数量")]
public int? ShipmentQty { get; set; }
/// <summary>
/// 行扫描率
/// </summary>
[SugarColumn(ColumnName = "ScanRate", ColumnDescription = "行扫描率", Length = 32)]
public string? ScanRate { get; set; }
}

View File

@ -276,3 +276,20 @@ public class QueryByIdInvoiceInput : DeleteInvoiceInput
{
}
/// <summary>
/// 更新发货单审核状态
/// </summary>
public class UpdateInvoiceAuditStateInput
{
/// <summary>
/// 主键
/// </summary>
public virtual string[] Ids { get; set; }
/// <summary>
///
/// </summary>
public virtual int? AuditStatus { get; set; }
}

View File

@ -130,6 +130,11 @@ public class InvoiceOutput
/// </summary>
public bool IsDelete { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public int? AuditState { get; set; }
}

View File

@ -4,6 +4,7 @@ using Admin.NET.Application.Entity;
using Microsoft.AspNetCore.Http;
using NewLife.Reflection;
using Nest;
using AngleSharp.Dom;
namespace Admin.NET.Application;
/// <summary>
@ -362,5 +363,26 @@ public class InvoiceService : IDynamicApiController, ITransient
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 更新发货单审核状态
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "UpdateAuditState")]
public async Task UpdateAuditState(UpdateInvoiceAuditStateInput input)
{
var list = await _rep.AsQueryable()
.Where(a => !a.IsDelete)
.Where(t => input.Ids.Contains(t.Id.ToString()))
.ToListAsync();
foreach (var item in list)
{
item.AuditState = input.AuditStatus;
await _rep.AsUpdateable(item).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
}
}

View File

@ -3,106 +3,135 @@ using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application;
/// <summary>
/// 物料列表基础输入参数
/// </summary>
public class MaterialListBaseInput
{
/// <summary>
/// 物料列表基础输入参数
/// 物料ID
/// </summary>
public class MaterialListBaseInput
{
/// <summary>
/// 物料ID
/// </summary>
public virtual long? MaterialsId { get; set; }
/// <summary>
/// 单位
/// </summary>
public virtual string? Unit { get; set; }
/// <summary>
/// 数量
/// </summary>
public virtual int? Count { get; set; }
/// <summary>
/// 来源ID
/// </summary>
public virtual long? SourceId { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string? Remarks { get; set; }
}
public virtual long? MaterialsId { get; set; }
/// <summary>
/// 物料列表分页查询输入参数
/// 单位
/// </summary>
public class MaterialListInput : BasePageInput
{
/// <summary>
/// 关键字查询
/// </summary>
public string? SearchKey { get; set; }
/// <summary>
/// 物料ID
/// </summary>
public long? MaterialsId { get; set; }
/// <summary>
/// 单位
/// </summary>
public string? Unit { get; set; }
/// <summary>
/// 数量
/// </summary>
public int? Count { get; set; }
/// <summary>
/// 来源ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
}
public virtual string? Unit { get; set; }
/// <summary>
/// 物料列表增加输入参
/// 数量
/// </summary>
public class AddMaterialListInput : MaterialListBaseInput
{
}
public virtual int? Count { get; set; }
/// <summary>
/// 物料列表删除输入参数
/// 来源ID
/// </summary>
public class DeleteMaterialListInput : BaseIdInput
{
}
public virtual long? SourceId { get; set; }
/// <summary>
/// 物料列表更新输入参数
/// 编码
/// </summary>
public class UpdateMaterialListInput : MaterialListBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
public string? CodeNum { get; set; }
/// <summary>
/// 物料列表主键查询输入参数
/// 备注
/// </summary>
public class QueryByIdMaterialListInput : DeleteMaterialListInput
{
public virtual string? Remarks { get; set; }
}
/// <summary>
/// 规格型号
/// </summary>
public virtual string? Specifications { get; set; }
/// <summary>
/// 计划数量
/// </summary>
public virtual int? PlanQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
public virtual int? ShipmentQty { get; set; }
/// <summary>
/// 行扫描率
/// </summary>
public virtual string? ScanRate { get; set; }
}
/// <summary>
/// 物料列表分页查询输入参数
/// </summary>
public class MaterialListInput : BasePageInput
{
/// <summary>
/// 关键字查询
/// </summary>
public string? SearchKey { get; set; }
/// <summary>
/// 物料ID
/// </summary>
public long? MaterialsId { get; set; }
/// <summary>
/// 单位
/// </summary>
public string? Unit { get; set; }
/// <summary>
/// 数量
/// </summary>
public int? Count { get; set; }
/// <summary>
/// 来源ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
}
/// <summary>
/// 物料列表增加输入参数
/// </summary>
public class AddMaterialListInput : MaterialListBaseInput
{
}
/// <summary>
/// 物料列表删除输入参数
/// </summary>
public class DeleteMaterialListInput : BaseIdInput
{
}
/// <summary>
/// 物料列表更新输入参数
/// </summary>
public class UpdateMaterialListInput : MaterialListBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 物料列表主键查询输入参数
/// </summary>
public class QueryByIdMaterialListInput : DeleteMaterialListInput
{
}

View File

@ -35,6 +35,31 @@ public class MaterialListOutput
/// </summary>
public string? Remarks { get; set; }
}
/// <summary>
/// 编码
/// </summary>
public string? CodeNum { get; set; }
/// <summary>
/// 规格型号
/// </summary>
public string? Specifications { get; set; }
/// <summary>
/// 计划数量
/// </summary>
public int? PlanQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
public int? ShipmentQty { get; set; }
/// <summary>
/// 行扫描率
/// </summary>
public string? ScanRate { get; set; }
}

View File

@ -303,3 +303,16 @@ public class QueryByIdProductRetrospectInput : DeleteProductRetrospectInput
{
}
/// <summary>
///
/// </summary>
public class CheckCodeStatusOutInput
{
/// <summary>
/// 状态
/// </summary>
public long State { get; set; }
}

View File

@ -172,32 +172,33 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "CheckCodeStatus")]
public async Task<int> CheckCodeStatus(string? productCode)
public async Task<CheckCodeStatusOutInput> CheckCodeStatus(string? productCode)
{
int state = 0;
var codeEnt = await _rep.AsQueryable().Where(u => !u.IsDelete && u.Code == productCode).Select<ProductRetrospectOutput>().ToListAsync();
if (codeEnt == null || codeEnt.Count<1)
{
return 0;
state = 0;
}
var last = codeEnt.OrderBy(a => a.WarehousingDate).FirstOrDefault();
var receipt = last.Receipt == null ? "" : last.Receipt;
if (receipt.Contains("汇报单"))
{
return 1;
state = 1;
}
else if (receipt.Contains("仓库"))
{
return 2;
state = 2;
}
else if (receipt.Contains("发货"))
{
return 3;
state = 3;
}
else if (receipt.Contains("分销"))
{
return 3;
state = 3;
}
return 3;
return new CheckCodeStatusOutInput { State = state };
}
public async Task AddRetrospect(PrintCodeDetail item ,ReportTable report,string receipt, string location ,long? sourceId,long? warehousingId)
{

View File

@ -0,0 +1,252 @@
<template>
<div class="warehouseDetails-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="物料" :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="goodCode">
<el-input v-model="ruleForm.goodCode" 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="materialsNum">
<el-input v-model="ruleForm.materialsNum" 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="specifications">
<el-input v-model="ruleForm.specifications" 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="classify">
<el-input v-model="ruleForm.classify" 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="count">
<el-input-number v-model="ruleForm.count" placeholder="请输入库存数量" 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="unit">
<el-input v-model="ruleForm.unit" 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="baseCount">
<el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" 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="baseUnit">
<el-input v-model="ruleForm.baseUnit" 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="packageScale">
<el-input v-model="ruleForm.packageScale" 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="batch">
<el-input v-model="ruleForm.batch" 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="custom">
<el-input v-model="ruleForm.custom" 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="brand">
<el-input v-model="ruleForm.brand" 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="codeType">
<el-input v-model="ruleForm.codeType" 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="codeCount">
<el-input-number v-model="ruleForm.codeCount" placeholder="请输入条码数量" 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="warehouseLocation">
<el-input v-model="ruleForm.warehouseLocation" 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="productDate">
<el-date-picker v-model="ruleForm.productDate" 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="loseDate">
<el-date-picker v-model="ruleForm.loseDate" 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="singleWeight">
<el-input v-model="ruleForm.singleWeight" 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="totalWeight">
<el-input v-model="ruleForm.totalWeight" 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="unitPrice">
<el-input v-model="ruleForm.unitPrice" placeholder="请输入单价" maxlength="10" 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="totalPrice">
<el-input v-model="ruleForm.totalPrice" placeholder="请输入总价" maxlength="10" 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="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="源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="仓库ID" prop="warehouseId">
<el-input v-model="ruleForm.warehouseId" placeholder="请输入仓库ID" 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="expandField">
<el-input v-model="ruleForm.expandField" placeholder="请输入拓展字段" maxlength="32" 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 { addWarehouseDetails, updateWarehouseDetails, detailWarehouseDetails } from "/@/api/main/warehouseDetails";
import { pageMaterials, deleteMaterials, listMaterials } from '/@/api/main/materials';
//
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 materials = ref<any>([]);
//
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 detailWarehouseDetails(rowData.id)).data.result;
else
ruleForm.value = rowData;
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true;
//console.log(materials.value);
};
//
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 addWarehouseDetails(values);
} else {
await updateWarehouseDetails(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,344 @@
<template>
<div class="warehouseDetails-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="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="商品条码">
<el-input v-model="queryParams.goodCode" 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.materialsNum" 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.specifications" 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.classify" 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-number v-model="queryParams.count" 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.unit" 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-number v-model="queryParams.baseCount" 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.baseUnit" 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.packageScale" 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.batch" 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.custom" 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.brand" 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.codeType" 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-number v-model="queryParams.codeCount" 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.warehouseLocation" 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.productDateRange" />
</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.loseDateRange" />
</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.singleWeight" 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.totalWeight" 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.unitPrice" 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.totalPrice" 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="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="源ID">
<el-input v-model="queryParams.sourceId" clearable="" placeholder="请输入源ID"/>
</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="仓库ID">
<el-input v-model="queryParams.warehouseId" clearable="" placeholder="请输入仓库ID"/>
</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.expandField" 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="'warehouseDetails: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="openAddWarehouseDetails" v-auth="'warehouseDetails: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="140" show-overflow-tooltip="" />
<el-table-column prop="goodCode" label="商品条码" width="140" show-overflow-tooltip="" />
<el-table-column prop="materialsNum" label="物料编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="specifications" label="规格" width="140" show-overflow-tooltip="" />
<el-table-column prop="classify" label="分类" width="140" show-overflow-tooltip="" />
<el-table-column prop="count" label="库存数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="unit" label="库存单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseCount" label="基本数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="packageScale" label="包装比例" width="140" show-overflow-tooltip="" />
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
<el-table-column prop="custom" label="公司" width="140" show-overflow-tooltip="" />
<el-table-column prop="brand" label="品牌" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeType" label="条码类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeCount" label="条码数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehouseLocation" label="库位" width="140" show-overflow-tooltip="" />
<el-table-column prop="productDate" label="生产日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="loseDate" label="失效日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="singleWeight" label="单重" width="140" show-overflow-tooltip="" />
<el-table-column prop="totalWeight" label="总重" width="140" show-overflow-tooltip="" />
<el-table-column prop="unitPrice" label="单价" width="140" show-overflow-tooltip="" />
<el-table-column prop="totalPrice" label="总价" width="140" show-overflow-tooltip="" />
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceId" label="源ID" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehouseId" label="仓库ID" width="140" show-overflow-tooltip="" />
<el-table-column prop="expandField" label="拓展字段" width="140" show-overflow-tooltip="" />
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('warehouseDetails:update') || auth('warehouseDetails:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWarehouseDetails(scope.row)" v-auth="'warehouseDetails:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWarehouseDetails(scope.row)" v-auth="'warehouseDetails: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="editWarehouseDetailsTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="warehouseDetails">
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/warehouseManagement/warehouseDetails/component/editDialog.vue'
import { pageWarehouseDetails, deleteWarehouseDetails } from '/@/api/main/warehouseDetails';
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 editWarehouseDetailsTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageWarehouseDetails(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 openAddWarehouseDetails = () => {
editWarehouseDetailsTitle.value = '添加仓库统计';
editDialogRef.value.openDialog({});
};
//
const openEditWarehouseDetails = (row: any) => {
editWarehouseDetailsTitle.value = '编辑仓库统计';
editDialogRef.value.openDialog(row);
};
//
const delWarehouseDetails = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteWarehouseDetails(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

@ -0,0 +1,203 @@
<template>
<div class="warehousingStatistics-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="物料" :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-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="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="count">
<el-input-number v-model="ruleForm.count" placeholder="请输入入库数量" 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="unit">
<el-input v-model="ruleForm.unit" 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="baseCount">
<el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" 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="baseUnit">
<el-input v-model="ruleForm.baseUnit" 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="brand">
<el-input v-model="ruleForm.brand" 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="specifications">
<el-input v-model="ruleForm.specifications" 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">
<el-input v-model="ruleForm.warehousingType" 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="来源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="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="入库仓库ID" prop="warehouseId">
<el-input v-model="ruleForm.warehouseId" 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="warehouseLocation">
<el-input v-model="ruleForm.warehouseLocation" 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="supplier">
<el-input v-model="ruleForm.supplier" 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="32" 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 { addWarehousingStatistics, updateWarehousingStatistics, detailWarehousingStatistics } from "/@/api/main/warehousingStatistics";
import { pageMaterials, deleteMaterials, listMaterials } from '/@/api/main/materials';
//
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 materials = ref<any>([]);
//
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 detailWarehousingStatistics(rowData.id)).data.result;
else
ruleForm.value = rowData;
materials.value = (await listMaterials()).data.result;
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 addWarehousingStatistics(values);
} else {
await updateWarehousingStatistics(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,287 @@
<template>
<div class="warehousingStatistics-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="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-number v-model="queryParams.count" 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.unit" 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-number v-model="queryParams.baseCount" 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.baseUnit" 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.brand" 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.specifications" 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.warehousingType" 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="物料ID">
<el-input v-model="queryParams.materialsId" clearable="" placeholder="请输入物料ID"/>
</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="来源ID">
<el-input v-model="queryParams.sourceId" clearable="" placeholder="请输入来源ID"/>
</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.warehousingDateRange" />
</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="入库仓库ID">
<el-input v-model="queryParams.warehouseId" clearable="" placeholder="请输入入库仓库ID"/>
</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.warehouseLocation" 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.supplier" 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="'warehousingStatistics: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="openAddWarehousingStatistics" v-auth="'warehousingStatistics: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="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="物料编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="count" label="入库数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="unit" label="入库单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseCount" label="基本数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="brand" label="品牌" width="140" show-overflow-tooltip="" />
<el-table-column prop="specifications" label="规格" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehousingType" label="入库类型" width="140" show-overflow-tooltip="" />
<!-- <el-table-column prop="materialsId" label="物料ID" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceId" label="来源ID" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehouseId" label="入库仓库ID" width="90" show-overflow-tooltip="" /> -->
<el-table-column prop="warehousingDate" label="入库日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="warehouseLocation" label="库位" width="140" show-overflow-tooltip="" />
<el-table-column prop="supplier" label="供应商" width="140" show-overflow-tooltip="" />
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column label="操作" width="120" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('warehousingStatistics:update') || auth('warehousingStatistics:delete')">
<template #default="scope">
<!-- <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWarehousingStatistics(scope.row)" v-auth="'warehousingStatistics: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="delWarehousingStatistics(scope.row)" v-auth="'warehousingStatistics: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"
/>
<printDetailDialog
ref="printDetailDialogRef"
:title="printDetailTableTitle"
/>
<editDialog
ref="editDialogRef"
:title="editWarehousingStatisticsTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="warehousingStatistics">
import { ref } from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
import { auth } from '/@/utils/authFunction';
import printDetailDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
import editDialog from '/@/views/warehouseManagement/warehousingStatistics/component/editDialog.vue'
import { pageWarehousingStatistics, deleteWarehousingStatistics } from '/@/api/main/warehousingStatistics';
const showAdvanceQueryUI = ref(false);
const printDetailDialogRef = ref();
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 editWarehousingStatisticsTitle = ref("");
const printDetailTableTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageWarehousingStatistics(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 openAddWarehousingStatistics = () => {
// editWarehousingStatisticsTitle.value = '';
// editDialogRef.value.openDialog({});
// };
// //
// const openEditWarehousingStatistics = (row: any) => {
// editWarehousingStatisticsTitle.value = '';
// editDialogRef.value.openDialog(row);
// };
//
const readReportDetailTable = (row: any) => {
printDetailTableTitle.value = '条码详情';
//console.log(row);
printDetailDialogRef.value.openDialog(row.id);
};
//
// const delWarehousingStatistics = (row: any) => {
// ElMessageBox.confirm(`?`, "", {
// confirmButtonText: "",
// cancelButtonText: "",
// type: "warning",
// })
// .then(async () => {
// await deleteWarehousingStatistics(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>