Compare commits
No commits in common. "7a1de2d58a52aab0f472086c8f1b5324e580b76a" and "82d925fa5ef0fdd2c6206f46f685b36b4050da2e" have entirely different histories.
7a1de2d58a
...
82d925fa5e
|
@ -112,10 +112,4 @@ public class Invoice : EntityTenant
|
||||||
[SugarColumn(ColumnName = "State", ColumnDescription = "状态")]
|
[SugarColumn(ColumnName = "State", ColumnDescription = "状态")]
|
||||||
public int? State { get; set; }
|
public int? State { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 审核状态
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnName = "AuditState", ColumnDescription = "状态")]
|
|
||||||
public int? AuditState { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,35 +37,4 @@ public class MaterialList : EntityBaseId
|
||||||
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 32)]
|
||||||
public string? Remarks { get; set; }
|
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; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,20 +276,3 @@ 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; }
|
|
||||||
|
|
||||||
}
|
|
|
@ -130,11 +130,6 @@ public class InvoiceOutput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsDelete { get; set; }
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 审核状态
|
|
||||||
/// </summary>
|
|
||||||
public int? AuditState { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ using Admin.NET.Application.Entity;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using NewLife.Reflection;
|
using NewLife.Reflection;
|
||||||
using Nest;
|
using Nest;
|
||||||
using AngleSharp.Dom;
|
|
||||||
|
|
||||||
namespace Admin.NET.Application;
|
namespace Admin.NET.Application;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -363,26 +362,5 @@ public class InvoiceService : IDynamicApiController, ITransient
|
||||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,40 +28,11 @@ public class MaterialListBaseInput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual long? SourceId { get; set; }
|
public virtual long? SourceId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 编码
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
public string? CodeNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string? Remarks { get; set; }
|
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>
|
||||||
|
|
|
@ -35,31 +35,6 @@ public class MaterialListOutput
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Remarks { get; set; }
|
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; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -303,16 +303,3 @@ public class QueryByIdProductRetrospectInput : DeleteProductRetrospectInput
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
public class CheckCodeStatusOutInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 状态
|
|
||||||
/// </summary>
|
|
||||||
public long State { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -172,33 +172,32 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ApiDescriptionSettings(Name = "CheckCodeStatus")]
|
[ApiDescriptionSettings(Name = "CheckCodeStatus")]
|
||||||
public async Task<CheckCodeStatusOutInput> CheckCodeStatus(string? productCode)
|
public async Task<int> CheckCodeStatus(string? productCode)
|
||||||
{
|
{
|
||||||
int state = 0;
|
|
||||||
var codeEnt = await _rep.AsQueryable().Where(u => !u.IsDelete && u.Code == productCode).Select<ProductRetrospectOutput>().ToListAsync();
|
var codeEnt = await _rep.AsQueryable().Where(u => !u.IsDelete && u.Code == productCode).Select<ProductRetrospectOutput>().ToListAsync();
|
||||||
if (codeEnt == null || codeEnt.Count<1)
|
if (codeEnt == null || codeEnt.Count<1)
|
||||||
{
|
{
|
||||||
state = 0;
|
return 0;
|
||||||
}
|
}
|
||||||
var last = codeEnt.OrderBy(a => a.WarehousingDate).FirstOrDefault();
|
var last = codeEnt.OrderBy(a => a.WarehousingDate).FirstOrDefault();
|
||||||
var receipt = last.Receipt == null ? "" : last.Receipt;
|
var receipt = last.Receipt == null ? "" : last.Receipt;
|
||||||
if (receipt.Contains("汇报单"))
|
if (receipt.Contains("汇报单"))
|
||||||
{
|
{
|
||||||
state = 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (receipt.Contains("仓库"))
|
else if (receipt.Contains("仓库"))
|
||||||
{
|
{
|
||||||
state = 2;
|
return 2;
|
||||||
}
|
}
|
||||||
else if (receipt.Contains("发货"))
|
else if (receipt.Contains("发货"))
|
||||||
{
|
{
|
||||||
state = 3;
|
return 3;
|
||||||
}
|
}
|
||||||
else if (receipt.Contains("分销"))
|
else if (receipt.Contains("分销"))
|
||||||
{
|
{
|
||||||
state = 3;
|
return 3;
|
||||||
}
|
}
|
||||||
return new CheckCodeStatusOutInput { State = state };
|
return 3;
|
||||||
}
|
}
|
||||||
public async Task AddRetrospect(PrintCodeDetail item ,ReportTable report,string receipt, string location ,long? sourceId,long? warehousingId)
|
public async Task AddRetrospect(PrintCodeDetail item ,ReportTable report,string receipt, string location ,long? sourceId,long? warehousingId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -261,7 +261,7 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
if (unit == null)
|
if (unit == null)
|
||||||
throw new ArgumentNullException(nameof(unitGroup));
|
throw new ArgumentNullException(nameof(unitGroup));
|
||||||
|
|
||||||
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 0 };
|
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 1 };
|
||||||
var addReport = await Add(newReport);
|
var addReport = await Add(newReport);
|
||||||
|
|
||||||
var others = units.FindAll(a => a.Rate < unit.Rate);
|
var others = units.FindAll(a => a.Rate < unit.Rate);
|
||||||
|
@ -436,38 +436,5 @@ public class ReportTableService : IDynamicApiController, ITransient
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新状态
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
|
||||||
[HttpPost]
|
|
||||||
[ApiDescriptionSettings(Name = "UpdateState")]
|
|
||||||
public async Task UpdateState(AddReportContext input)
|
|
||||||
{
|
|
||||||
var unitGroup = await _repUnitGroup.Detail(new QueryByIdSysUnitGroupInput() { Id = input.UnitGroupId });
|
|
||||||
if (unitGroup == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(unitGroup));
|
|
||||||
}
|
|
||||||
var units = await _repUnit.ListByGroupId(unitGroup.Id);
|
|
||||||
if (units == null || units.Count < 1)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(unitGroup));
|
|
||||||
}
|
|
||||||
var unit = units.Find(a => a.Name == input.Name);
|
|
||||||
if (unit == null)
|
|
||||||
throw new ArgumentNullException(nameof(unitGroup));
|
|
||||||
|
|
||||||
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = DateTime.Now.ToString("yyyyMMddhhmmss"), State = 0 };
|
|
||||||
var addReport = await Add(newReport);
|
|
||||||
|
|
||||||
var others = units.FindAll(a => a.Rate < unit.Rate);
|
|
||||||
|
|
||||||
var entity = input.Adapt<ReportTable>();
|
|
||||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ enum Api {
|
||||||
UpdateInvoice = '/api/invoice/update',
|
UpdateInvoice = '/api/invoice/update',
|
||||||
PageInvoice = '/api/invoice/page',
|
PageInvoice = '/api/invoice/page',
|
||||||
DetailInvoice = '/api/invoice/detail',
|
DetailInvoice = '/api/invoice/detail',
|
||||||
UpdateAuditStateInvoice = '/api/invoice/UpdateAuditState',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 增加发货通知单
|
// 增加发货通知单
|
||||||
|
@ -48,13 +47,4 @@ export const detailInvoice = (id: any) =>
|
||||||
data: { id },
|
data: { id },
|
||||||
});
|
});
|
||||||
|
|
||||||
// 审核汇报单
|
|
||||||
export const updateAuditStateInvoice = (params?: any) =>
|
|
||||||
request({
|
|
||||||
url: Api.UpdateAuditStateInvoice,
|
|
||||||
method: 'post',
|
|
||||||
data: params,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="invoice-container" >
|
<div class="invoice-container" style="height: 100vh">
|
||||||
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" >
|
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" >
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-row :gutter="35">
|
<el-row :gutter="35">
|
||||||
|
@ -114,9 +114,8 @@
|
||||||
<el-card class="box-card" >
|
<el-card class="box-card" >
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<el-button type="primary" icon="ele-Plus" @click="addColumn">新增物料</el-button>
|
<span>明细信息</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<el-table
|
<el-table
|
||||||
:data="ruleForm.tableData"
|
:data="ruleForm.tableData"
|
||||||
|
@ -126,43 +125,28 @@
|
||||||
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(scope.row)">
|
<el-select v-model="scope.row.materialsId" placeholder="请选择" autocomplete="off" controls-position="right" clearable @change="materialsChange">
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item, index in materials" :key="index" />
|
<el-option :label="item.name" :value="item.id" v-for="item, index in materials" :key="index" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="codeNum" label="商品编码" width="100" show-overflow-tooltip="" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.codeNum" autocomplete="off" controls-position="right"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="specifications" label="规格型号" width="100" show-overflow-tooltip="" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.specifications" autocomplete="off" controls-position="right"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="planQty" label="计划数量" width="120" show-overflow-tooltip="" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input-number v-model="scope.row.planQty" autocomplete="off" controls-position="right" @change="qtyChange(scope.row)"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="shipmentQty" label="发货数量" width="120" show-overflow-tooltip="" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input-number v-model="scope.row.shipmentQty" autocomplete="off" controls-position="right" @change="qtyChange(scope.row)"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="unit" label="单位" width="120" show-overflow-tooltip="" >
|
<el-table-column prop="unit" label="单位" width="120" show-overflow-tooltip="" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.unit" placeholder="请选择" autocomplete="off" controls-position="right" clearable>
|
<el-select v-model="scope.row.unit" placeholder="请选择" clearable autocomplete="off" >
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item, index in units" :key="index" />
|
<el-option :label="item.name" :value="item.name" v-for="item, index in units" :key="index" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="scanRate" label="行扫描率" width="120" show-overflow-tooltip="" >
|
<el-table-column prop="count" label="数量" width="100" show-overflow-tooltip="" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.scanRate" autocomplete="off" controls-position="right" :formatter="formatScanRate"/>
|
<el-input-number v-model="scope.row.count" autocomplete="off" controls-position="right"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.remarks" autocomplete="off" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<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="" >
|
||||||
|
@ -172,7 +156,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-button icon="ele-Plus" @click="addColumn">新增物料</el-button>
|
||||||
<div class="footer" align="right" >
|
<div class="footer" align="right" >
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
<el-button type="primary" @click="submit" :disabled="props.disabled">确 定</el-button>
|
<el-button type="primary" @click="submit" :disabled="props.disabled">确 定</el-button>
|
||||||
|
@ -190,14 +174,15 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {onMounted, ref} from 'vue';
|
import { ref, onMounted, reactive } from 'vue';
|
||||||
import type {FormRules} from "element-plus";
|
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import {addInvoice, detailInvoice, updateInvoice} from "/@/api/main/invoice";
|
import type { FormRules } from "element-plus";
|
||||||
|
import { addInvoice, updateInvoice, detailInvoice } from "/@/api/main/invoice";
|
||||||
import { listWarehouse } from '/@/api/main/warehouse';
|
import { listWarehouse } from '/@/api/main/warehouse';
|
||||||
import { listSupplier } from '/@/api/main/supplier';
|
import { listSupplier } from '/@/api/main/supplier';
|
||||||
import { listCustom } from '/@/api/main/custom';
|
import { listCustom } from '/@/api/main/custom';
|
||||||
import {detailMaterials, listMaterials, materialListBySourceId} from '/@/api/main/materials';
|
import { listMaterials, detailMaterials, materialListBySourceId } from '/@/api/main/materials';
|
||||||
import { listUnitGroup } from '/@/api/main/unit';
|
import { listUnitGroup } from '/@/api/main/unit';
|
||||||
import { getCurrentDate } from '/@/utils/formatTime';
|
import { getCurrentDate } from '/@/utils/formatTime';
|
||||||
|
|
||||||
|
@ -224,13 +209,6 @@ import {getCurrentDate} from '/@/utils/formatTime';
|
||||||
const units = ref<any>([]);
|
const units = ref<any>([]);
|
||||||
const tableData = ref<any>([]);
|
const tableData = ref<any>([]);
|
||||||
|
|
||||||
const formatScanRate = (value) => {
|
|
||||||
if (value) {
|
|
||||||
return `${value}%`;
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
//自行添加其他规则
|
//自行添加其他规则
|
||||||
const rules = ref<FormRules>({
|
const rules = ref<FormRules>({
|
||||||
// businessType: [{required: true, message: '请输入业务类型!', trigger: 'blur',},],
|
// businessType: [{required: true, message: '请输入业务类型!', trigger: 'blur',},],
|
||||||
|
@ -277,13 +255,10 @@ import {getCurrentDate} from '/@/utils/formatTime';
|
||||||
* 物料值变更
|
* 物料值变更
|
||||||
* @param clearBindUserId 是否清空
|
* @param clearBindUserId 是否清空
|
||||||
*/
|
*/
|
||||||
const materialsChange = async (row : any) => {
|
const materialsChange = async (value : any) => {
|
||||||
//ruleForm.value.materialsId=value.id;
|
//ruleForm.value.materialsId=value.id;
|
||||||
let material = (await detailMaterials(row.materialsId)).data.result;
|
let material = (await detailMaterials(value)).data.result;
|
||||||
//console.log(material);
|
//console.log(material);
|
||||||
row.specifications = material.specifications;
|
|
||||||
row.codeNum = material.codeNum;
|
|
||||||
row.unit = material.unit;
|
|
||||||
if(material.id){
|
if(material.id){
|
||||||
var res = await listUnitGroup(material.unitGroupId ?? 0);
|
var res = await listUnitGroup(material.unitGroupId ?? 0);
|
||||||
units.value = res.data.result ?? [];
|
units.value = res.data.result ?? [];
|
||||||
|
@ -291,21 +266,9 @@ import {getCurrentDate} from '/@/utils/formatTime';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 数量change事件
|
|
||||||
* @param row
|
|
||||||
*/
|
|
||||||
const qtyChange = async (row : any) => {
|
|
||||||
if(row.shipmentQty && row.shipmentQty) {
|
|
||||||
row.scanRate=Math.round((row.shipmentQty / row.planQty) * 100);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 增加列
|
// 增加列
|
||||||
function addColumn() {
|
function addColumn() {
|
||||||
if(!ruleForm.value.tableData){
|
|
||||||
ruleForm.value.tableData=[];
|
|
||||||
}
|
|
||||||
ruleForm.value.tableData.push({
|
ruleForm.value.tableData.push({
|
||||||
materialsId: null,
|
materialsId: null,
|
||||||
unit: '箱',
|
unit: '箱',
|
||||||
|
|
|
@ -107,8 +107,6 @@
|
||||||
<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" style="margin-left:5px;"> 高级查询 </el-button>
|
||||||
<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="openAddInvoice" v-auth="'invoice:add'"> 新增 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddInvoice" v-auth="'invoice:add'"> 新增 </el-button>
|
||||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Check" @click="handleAuditStateChange('1')" > 审核 </el-button>
|
|
||||||
<el-button type="primary" style="margin-left:5px;" icon="ele-CloseBold" @click="handleAuditStateChange('0')" > 反审核 </el-button>
|
|
||||||
|
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -125,9 +123,7 @@
|
||||||
tooltip-effect="light"
|
tooltip-effect="light"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
border="">
|
border="">
|
||||||
<el-table-column type="selection" width="60"/>
|
|
||||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||||
<el-table-column prop="codeNum" label="单号" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="codeNum" label="单号" width="140" show-overflow-tooltip="" />
|
||||||
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
|
||||||
|
@ -144,19 +140,12 @@
|
||||||
<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 prop="state" label="发货状态" width="140" show-overflow-tooltip :formatter="formatState">
|
||||||
<el-table-column prop="auditState" label="审核状态" width="140" show-overflow-tooltip="" :formatter="formatAuditState"/>
|
</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">
|
||||||
<div v-if="scope.row.auditState===1">
|
|
||||||
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openBrowseInvoice(scope.row)" v-auth="'reportDetailTable:update'"> 详情 </el-button>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<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>
|
||||||
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delInvoice(scope.row)" v-auth="'invoice:delete'"> 删除 </el-button>
|
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delInvoice(scope.row)" v-auth="'invoice:delete'"> 删除 </el-button>
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -178,7 +167,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="reportDetailTable-container">
|
<div v-else class="reportDetailTable-container">
|
||||||
<el-card style="height: 100vh;overflow-y:scroll">
|
<el-card >
|
||||||
<editDialog
|
<editDialog
|
||||||
ref="editDialogRef"
|
ref="editDialogRef"
|
||||||
:row = "state.editRow"
|
:row = "state.editRow"
|
||||||
|
@ -199,8 +188,7 @@ import {reactive, ref} from "vue";
|
||||||
|
|
||||||
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
import printDialog from '/@/views/labelPrinting/print/component/hiprint/preview.vue'
|
||||||
import editDialog from '/@/views/inventoryManagement/invoice/component/editDialog.vue'
|
import editDialog from '/@/views/inventoryManagement/invoice/component/editDialog.vue'
|
||||||
import {pageInvoice, deleteInvoice, updateAuditStateInvoice} from '/@/api/main/invoice';
|
import { pageInvoice, deleteInvoice } from '/@/api/main/invoice';
|
||||||
import {updateStateReportDetailTable} from "/@/api/main/reportDetailTable";
|
|
||||||
|
|
||||||
|
|
||||||
const showAdvanceQueryUI = ref(false);
|
const showAdvanceQueryUI = ref(false);
|
||||||
|
@ -222,20 +210,6 @@ import {updateStateReportDetailTable} from "/@/api/main/reportDetailTable";
|
||||||
|
|
||||||
const printInvoiceTitle = ref("");
|
const printInvoiceTitle = ref("");
|
||||||
const editInvoiceTitle = ref("");
|
const editInvoiceTitle = ref("");
|
||||||
const multipleSelection = ref([])
|
|
||||||
const handleSelectionChange = (val: []) => {
|
|
||||||
multipleSelection.value = val
|
|
||||||
}
|
|
||||||
//修改审核状态
|
|
||||||
const handleAuditStateChange = async (val: any) => {
|
|
||||||
if(multipleSelection.value.length === 0){ return ElMessage.error("至少选择一条数据")}
|
|
||||||
let ids = [] as any;
|
|
||||||
multipleSelection.value.forEach(item => {
|
|
||||||
ids.push(item.id);
|
|
||||||
})
|
|
||||||
await updateAuditStateInvoice({ids,auditStatus:val});
|
|
||||||
await handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 改变高级查询的控件显示状态
|
// 改变高级查询的控件显示状态
|
||||||
const changeAdvanceQueryUI = () => {
|
const changeAdvanceQueryUI = () => {
|
||||||
|
@ -246,10 +220,6 @@ import {updateStateReportDetailTable} from "/@/api/main/reportDetailTable";
|
||||||
return cellValue === 1 ? '装货中' : '未装货';
|
return cellValue === 1 ? '装货中' : '未装货';
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatAuditState = (row, column, cellValue) => {
|
|
||||||
return cellValue === 1 ? '已审核' : '未审核';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关闭页面
|
// 关闭页面
|
||||||
const close = () => {
|
const close = () => {
|
||||||
state.editShow = false;
|
state.editShow = false;
|
||||||
|
@ -291,13 +261,6 @@ import {updateStateReportDetailTable} from "/@/api/main/reportDetailTable";
|
||||||
state.editDisabled = false;
|
state.editDisabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//打开详情界面
|
|
||||||
const openBrowseInvoice = (row: any) => {
|
|
||||||
state.editRow = row;
|
|
||||||
state.editShow = true;
|
|
||||||
state.editDisabled = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const delInvoice = (row: any) => {
|
const delInvoice = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
||||||
|
|
|
@ -1,252 +0,0 @@
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,344 +0,0 @@
|
||||||
<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>
|
|
||||||
|
|
|
@ -1,203 +0,0 @@
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,287 +0,0 @@
|
||||||
<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>
|
|
||||||
|
|
Loading…
Reference in New Issue