😭更改工艺路线、BOM物料查询条件,更改批量同步物料逻辑

This commit is contained in:
bairubing 2024-10-30 15:59:19 +08:00
parent 752b1bedf5
commit 7bcd018514
9 changed files with 259 additions and 79 deletions

View File

@ -13,36 +13,129 @@ using System.Threading.Tasks;
namespace Vistar.Application.SapService.Dto;
public class SapMaterialInput
{
/// <summary>
/// 接口唯一ID
/// </summary>
public string Reqkeyid { get; set; }
/// <summary>
/// 业务唯一ID
/// </summary>
public string Businessid { get; set; }
/// <summary>
/// 业务唯一ID
/// </summary>
public string Messageid { get; set; }
/// <summary>
/// 发送方的合作伙伴编号
/// </summary>
public string Sndprn { get; set; }
/// <summary>
/// 接收方的合作伙伴编号
/// </summary>
public string Rcvprn { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string Requser { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note1 { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note2 { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note3 { get; set; }
/// <summary>
/// 外部唯一ID
/// </summary>
public string Zwbid { get; set; }
/// <summary>
/// 物料编号
/// </summary>
public string Matnr { get; set; }
/// <summary>
/// 行业
/// </summary>
public string Mbrsh { get; set; }
/// <summary>
/// 物料类型
/// </summary>
public string Mtart { get; set; }
/// <summary>
/// 物料描述
/// </summary>
public string Maktx { get; set; }
/// <summary>
/// 基本计量单位
/// </summary>
public string Meins { get; set; }
/// <summary>
/// 物料组
/// </summary>
public string Matkl { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string Bismt { get; set; }
/// <summary>
/// 设备型号
/// </summary>
public string Groes { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Normt { get; set; }
/// <summary>
/// 材质
/// </summary>
public string Ferth { get; set; }
/// <summary>
/// 表面处理
/// </summary>
public string Zeinr { get; set; }
/// <summary>
/// 跨工厂物料状态
/// </summary>
public string Mstae { get; set; }
/// <summary>
/// 存储条件
/// </summary>
public string Raube { get; set; }
/// <summary>
/// 最短剩余货架寿命
/// </summary>
public string Mhdrz { get; set; }
/// <summary>
/// 总货架寿命
/// </summary>
public string Mhdhb { get; set; }
/// <summary>
/// 工厂
/// </summary>
public string Werks { get; set; }
/// <summary>
/// 采购类型
/// </summary>
public string Beskz { get; set; }
/// <summary>
/// 特殊采购类型
/// </summary>
public string Sobsl { get; set; }
/// <summary>
/// 指示符:散装物料
/// </summary>
public string Schgt { get; set; }
/// <summary>
/// 标识:反冲
/// </summary>
public string Rgekz { get; set; }
/// <summary>
/// 是否BOM内物料
/// </summary>
public string Zbom { get; set; }
}

View File

@ -183,7 +183,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
public async Task<SqlSugarPagedList<ProductManagementBomOutput>> GetBOM(BomPageProductManagementInput input)
{
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 110 && x.ConfigSystemName == "mBOM").FirstAsync();
var parent = await _obj110Rep.AsQueryable().Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false).MaxAsync(x => x.VersionIndex);
var parent = await _obj110Rep.AsQueryable().Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x.fld004311 == "成功" && x.fld004312 == "N").MaxAsync(x => x.VersionIndex);
var BomData = await _configurationDataRep.AsQueryable()
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005586 !="不包含"|| x.fld005586==null))
.WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim()))
@ -328,7 +328,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
public async Task<List<SapOutput>> BatchSyncToSAP(List<ProductManagementBaseInput> input)
{
const string lengthError = "物料描述长度大于40请检查";
const string synchronized = "该物料编码已同步";
const string synchronized = "该物料编码已同步或已停用";
var SapOutputList = new List<SapOutput>();
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
for (int i = 0; i < input.Count; i++)
@ -356,7 +356,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
});
continue;
}
if (input[i].fld004312 != "A" || input[i].fld004312 != "M" || input[i].fld004312==null)
if (input[i].fld004312 == "N" || input[i].fld004312 == "D" || input[i].fld004312==null)
{
SapOutputList.Add(new SapOutput()
{
@ -444,7 +444,11 @@ public class ProductManagementService : IDynamicApiController, ITransient
public async Task<List<SapOutput>> TimingSyncToSAP()
{
var input = await _obj110Rep.AsQueryable()
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && (x.fld004312 == "A" || x.fld004312 == "M"))
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1)
&& x.fld005324 == "发布"
&& x.deleted == false
&& x.IsLatestVersion == true
&& (x.fld004312 == "A" || x.fld004312 == "M"))
.ToListAsync();
const string lengthError = "物料描述长度大于40请检查";
var SapOutputList = new List<SapOutput>();
@ -557,7 +561,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 110 && x.ConfigSystemName == "mBOM").FirstAsync();
var materialData = await _obj110Rep.AsQueryable()
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004316 == "A" || x.fld004316 == "M"))
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && x.fld004312=="N" && (x.fld004316 == "A" || x.fld004316 == "M"))
.ToListAsync();
var groupedData = materialData.GroupBy(item => item.RecordGuid)
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
@ -728,7 +732,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
[DisplayName("产品管理-工艺路线同步到SAP")]
public async Task<SapOutput> SyncToSAPProcessRoute(List<BomPageProductManagementInput> input)
{
var ParentData = await _obj110Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion).FirstAsync();
var ParentData = await _obj110Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && x.fld004311 == "成功" && x.fld004312 == "N" && x.fld005324 == "发布").FirstAsync();
var itemDataList = new List<SapProcessRouteItemData>();
@ -830,7 +834,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
//查询需要同步的产品
var materialData = await _obj110Rep.AsQueryable()
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && (x.fld004320 == "A" || x.fld004320 == "M"))
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld005324 == "发布" && x.deleted == false && x.IsLatestVersion == true && x.fld004311 == "成功" && x.fld004312 == "N" && (x.fld004320 == "A" || x.fld004320 == "M"))
.ToListAsync();
//分组查询最大版本的物料
var groupedData = materialData.GroupBy(item => item.RecordGuid)

View File

@ -73,7 +73,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
public async Task<SqlSugarPagedList<ProductDesignLibraryOutput>> Page(PageProductDesignLibraryInput input)
{
var query = await _obj137Rep.AsQueryable()
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && (x.SWPDMFileName!= "SLDDRW" || x.SWPDMFileName==null))
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input._SWPDM_1188_SAP___), u => u._SWPDM_1188_SAP___.Contains(input._SWPDM_1188_SAP___.Trim()))
.Select<ProductDesignLibraryOutput>()
@ -192,7 +192,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
.Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.MaxAsync(x => x.VersionIndex);
var BomData = await _configurationDataRep.AsQueryable()
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含"||x.fld005577==null))
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null))
.WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim()))
.Select<ProductDesignLibraryBomOutput>().ToPagedListAsync(input.Page, input.PageSize);
@ -207,7 +207,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
[DisplayName("产品设计库-Bom同步到SAP")]
public async Task<SapOutput> SyncToSAPBom(List<BomPageProductDesignLibraryInput> input)
{
var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && (x._SWPDM_1202_SW_____ != "不展开"||x._SWPDM_1202_SW_____==null)).FirstAsync();
var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)).FirstAsync();
var EcnData = await _obj118Rep.AsQueryable().Where(x => x.RecordGuid == ParentData.fld005679_Rec && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync();
var ecn = "";
if (EcnData != null)
@ -335,7 +335,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
public async Task<List<SapOutput>> BatchSyncToSAP(List<ProductDesignLibraryInput> input)
{
const string lengthError = "物料描述长度大于40请检查";
const string synchronized = "该物料编码已同步";
const string synchronized = "该物料编码已同步或已停用";
var SapOutputList = new List<SapOutput>();
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
for (int i = 0; i < input.Count; i++)
@ -363,7 +363,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
});
continue;
}
if (input[i].fld005530 != "A" && input[i].fld005530 != "M")
if (input[i].fld005530 == "N" || input[i].fld005530=="D"|| input[i].fld005530 ==null)
{
SapOutputList.Add(new SapOutput()
{
@ -564,7 +564,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync();
var materialData = await _obj137Rep.AsQueryable()
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && x.SWPDMFileName != "SLDDRW")
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.ToListAsync();
var groupedData = materialData.GroupBy(item => item.RecordGuid)
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
@ -719,7 +719,17 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
{
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "pBOM").FirstAsync();
var parent = await _obj137Rep.AsQueryable()
.Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.Where(x =>
x.RecordGuid == input.ParentGuid
&& x.CheckedStatus == 0
&& x.deleted == false
&& x._system_objConfigurationName == "默认"
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
&& x.fld005530 == "N"
&& x.fld005529 == "成功"
&& (x.fld005537 == "A" || x.fld005537 == "M")
)
.MaxAsync(x => x.VersionIndex);
var BomData = await _configurationDataRep.AsQueryable()
.Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent)
@ -739,7 +749,18 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
public async Task<SapOutput> SyncToSAPProcessRoute(List<BomPageProductDesignLibraryInput> input)
{
var ParentData = await _obj137Rep.AsQueryable()
.Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.Where(x =>
x.RecordGuid == input[0].ParentGuid
&& x.deleted == false
&& x.VersionIndex == input[0].ParentVersion
&& x._system_objConfigurationName == "默认"
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
&& x.CheckedStatus == 0
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
&& x.fld005530 == "N"
&& x.fld005529 == "成功"
&& (x.fld005537 == "A" || x.fld005537 == "M")
)
.FirstAsync();
var itemDataList = new List<SapProcessRouteItemData>();
@ -842,7 +863,17 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient
//查询需要同步的产品
var materialData = await _obj137Rep.AsQueryable()
.Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x.fld005529 == "成功" && (x.fld005537 == "A" || x.fld005537 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null))
.Where(x =>
x.CheckedStatus == 0
&& x.deleted == false
&& x.IsLatestVersion == true
&& x._system_objConfigurationName == "默认"
&& (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)
&& (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null)
&& x.fld005530 == "N"
&& x.fld005529 == "成功"
&& (x.fld005537 == "A" || x.fld005537 == "M")
)
.ToListAsync();
//分组查询最大版本的物料
var groupedData = materialData.GroupBy(item => item.RecordGuid)

View File

@ -176,7 +176,7 @@ public class ProductionMaterialsManagementService : IDynamicApiController, ITran
public async Task<List<SapOutput>> BatchSyncToSAP(List<ProductionMaterialsManagementInput> input)
{
const string lengthError = "物料描述长度大于40请检查";
const string synchronized = "该项目编号已同步";
const string synchronized = "该项目编号已同步或已停用";
var SapOutputList = new List<SapOutput>();
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
for (int i = 0; i < input.Count; i++)
@ -204,7 +204,7 @@ public class ProductionMaterialsManagementService : IDynamicApiController, ITran
});
continue;
}
if (input[i].fld004607 != "A" || input[i].fld004607 != "M" || input[i].fld004607 == null)
if (input[i].fld004607 == "N" || input[i].fld004607 == "D" || input[i].fld004607 == null)
{
SapOutputList.Add(new SapOutput()
{

View File

@ -184,7 +184,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
public async Task<List<SapOutput>> BatchSyncToSAP(List<ProjectManagementInput> input)
{
const string lengthError = "物料描述长度大于40请检查";
const string synchronized = "该项目编号已同步";
const string synchronized = "该项目编号已同步或已停用";
var SapOutputList = new List<SapOutput>();
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
for (int i = 0; i < input.Count; i++)
@ -212,7 +212,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
});
continue;
}
if (input[i].fld004510 != "A" || input[i].fld004510 != "M" || input[i].fld004510 == null)
if (input[i].fld004510 == "N" || input[i].fld004510 == "D" || input[i].fld004510 == null)
{
SapOutputList.Add(new SapOutput()
{
@ -526,7 +526,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 109 && x.ConfigSystemName == "mBOM").FirstAsync();
var materialData = await _obj109Rep.AsQueryable()
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" && x.fld004511 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" &&x.fld004510=="N" && x.fld004511 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
.ToListAsync();
var groupedData = materialData.GroupBy(item => item.RecordGuid)
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
@ -756,7 +756,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
//查询需要同步的产品
var materialData = await _obj109Rep.AsQueryable()
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" && x.fld004511 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" &&x.fld004510=="N" && x.fld004511 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
.ToListAsync();
//分组查询最大版本的物料
var groupedData = materialData.GroupBy(item => item.RecordGuid)

View File

@ -255,4 +255,50 @@ public class SolidWorksManageService : IDynamicApiController, ITransient
}
}
/// <summary>
/// 导出相关文件(全部)
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<ManageResponse> ExportRelatedFiles(CheckDataInput input)
{
// 获取 SolidWorksManage 地址
string apiUrl = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SolidWorksManageApiUrl);
// 拼接接口地址
string url = $"{apiUrl}/api/File/ExportRelatedFiles?object_id=138&record_id=4";
//获取token
var token = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SolidWorksManageAuthorization);
//// 将参数对象序列化为 JSON 字符串
//string jsonParameters = JsonConvert.SerializeObject(input);
//// 设置请求内容
//var content = new StringContent(jsonParameters, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Remove("Authorization");
// 添加 Authorization 到请求头
client.DefaultRequestHeaders.Add("Authorization", token);
// 发送 POST 请求
HttpResponseMessage response = await client.GetAsync(url);
// 处理响应
if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
// 解析 JSON 数据
var result = JsonConvert.DeserializeObject<ManageResponse>(responseBody);
return result;
}
else
{
string responseBody = await response.Content.ReadAsStringAsync();
var errorResponse = new ManageResponse()
{
Success = false,
Message = responseBody,
Data = "",
CustomAction = "",
CustomAttributes = ""
};
return errorResponse;
}
}
}

View File

@ -1,10 +1,10 @@
<template>
<div class="productDesignLibrary-container">
<el-card shadow="hover"
<div class="productDesignLibrary-container">
<el-card shadow="hover"
:body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQuery">
<el-row :gutter="10">
<el-row :gutter="10">
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="6" class="mb5">
<el-form-item label="产品设计库编号" prop="_System_objNBS">
<el-input v-model="state.queryParams._System_objNBS" placeholder="产品设计库编号" clearable
@ -17,43 +17,46 @@
@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5">
<el-button type="primary" icon="ele-Search" @click="handleQuery"
v-auth="'productDesignLibrary/page'" :loading="options.loading"> 查询 </el-button>
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
<template #toolbar_tools>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
<template #toolbar_tools>
<el-button style="position: absolute; left: 0" icon="ele-Promotion" size="small" text=""
type="success" @click="batchSyncToSAP" v-auth="'productDesignLibrary/batchSyncToSAP'"> 批量同步到SAP
</el-button>
</template>
<template #row_buttons="{ row }">
<el-tooltip content="同步BOM" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="getBOM(row)"
v-auth="'productDesignLibrary/getBOM'" v-if="(row.fld005534=='A'||row.fld005534=='M')&&row.fld005529=='成功'&& row._SWPDM_1202_SW_____ != '不展开'" >
同步BOM </el-button>
<template #row_buttons="{ row }">
<el-tooltip content="同步BOM" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="getBOM(row)"
v-auth="'productDesignLibrary/getBOM'"
v-if="(row.fld005534 == 'A' || row.fld005534 == 'M') && row.fld005530 == 'N' && row.fld005529 == '成功' && row._SWPDM_1202_SW_____ != '不展开'">
同步BOM </el-button>
</el-tooltip>
<el-tooltip content="工艺路线" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="examineProcessRoute(row)"
v-if="(row.fld005537=='A'||row.fld005537=='M')&&row.fld005529=='成功'">
<el-tooltip content="工艺路线" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary"
@click="examineProcessRoute(row)"
v-if="(row.fld005537 == 'A' || row.fld005537 == 'M') && row.fld005529 == '成功' && row.fld005530 == 'N' && row._SWPDM_1202_SW_____ != '不展开'">
工艺路线 </el-button>
</el-tooltip>
<el-tooltip content="同步到ERP" placement="top">
<el-button icon="ele-Promotion" size="small" text="" type="success" @click="syncToSAP(row)"
v-auth="'productDesignLibrary/syncToSAP'" v-if="row.fld005530=='A'||row.fld005530=='M'"> 同步到SAP </el-button>
v-auth="'productDesignLibrary/syncToSAP'" v-if="row.fld005530 == 'A' || row.fld005530 == 'M'">
同步到SAP </el-button>
</el-tooltip>
</template>
</vxe-grid>
</el-card>
</template>
</vxe-grid>
</el-card>
<!-- 添加 drawer 抽屉 -->
<!-- 添加 drawer 抽屉 -->
<el-drawer v-model="showBom" title="BOM 详情" :direction="'rtl'" :visible.sync="false" size="50%">
<!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
@ -75,22 +78,25 @@
<el-drawer v-model="showProcessRoute" title="工艺路线" :direction="'rtl'" :visible.sync="false" size="50%">
<!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
<el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%;display: none; " @submit.prevent="handleQueryProcessRoute">
<el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryProcessRoute" />
<el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false"
:inlineMessage="true" label-width="auto" style="flex: 1 1 0%;display: none; "
@submit.prevent="handleQueryProcessRoute">
<el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID"
@click="handleQueryProcessRoute" />
</el-form>
<vxe-grid ref="processRoutexGrid" v-bind="processRouteOptions" v-on="gridEvents">
<template #toolbar_tools>
<el-button style="position: absolute; left: 0" icon="ele-Promotion" size="small" text=""
type="success" @click="syncToSAPprocessRoute" v-auth="'productDesignLibrary/syncToSAPProcessRoute'"> 工艺路线同步到SAP
type="success" @click="syncToSAPprocessRoute"
v-auth="'productDesignLibrary/syncToSAPProcessRoute'"> 工艺路线同步到SAP
</el-button>
</template>
</vxe-grid>
</el-card>
</el-drawer>
</div>
</div>
</template>
<script lang="ts" setup name="productDesignLibrary">
import { onMounted, reactive, ref } from 'vue';
@ -102,7 +108,7 @@ import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
import { Local } from '/@/utils/storage';
import { formatDate } from '/@/utils/formatTime';
import { PageProductDesignLibrary, SyncToSAPProductDesignLibrary, GetBOMProductDesignLibrary, BatchSyncToSAPProductDesignLibrary, SyncToSAPBomProductDesignLibrary ,GetetProcessRouteProductDesignLibrary,SyncToSAPProcessRouteProductDesignLibrary} from '/@/api/materialManagement/productDesignLibrary';
import { PageProductDesignLibrary, SyncToSAPProductDesignLibrary, GetBOMProductDesignLibrary, BatchSyncToSAPProductDesignLibrary, SyncToSAPBomProductDesignLibrary, GetetProcessRouteProductDesignLibrary, SyncToSAPProcessRouteProductDesignLibrary } from '/@/api/materialManagement/productDesignLibrary';
import { disable } from 'ol/rotationconstraint';
//
@ -158,7 +164,7 @@ const options = useVxeTable(
id: 'productDesignLibrary',
name: '产品设计库管理',
columns: [
{ type: 'checkbox', title: '', width: 60},
{ type: 'checkbox', title: '', width: 60 },
{ type: 'seq', title: '序号', width: 60 },
{ field: '_System_objNBS', title: '产品设计库编号', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{ field: '_SWPDM_1188_SAP___', title: '描述', minWidth: 100, showOverflow: 'tooltip', sortable: false },
@ -217,9 +223,9 @@ const handleQuery = async (reset = false) => {
const syncToSAP = async (row: any) => {
options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -236,9 +242,9 @@ const syncToSAP = async (row: any) => {
//
loadingInstance.close();
})
.catch(() => {
.catch(() => {
//
loadingInstance.close();
loadingInstance.close();
});
options.loading = false;
@ -248,9 +254,9 @@ const syncToSAP = async (row: any) => {
const batchSyncToSAP = async () => {
options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords();
@ -278,11 +284,11 @@ const batchSyncToSAP = async () => {
confirmButtonText: 'OK'
})
//
loadingInstance.close();
loadingInstance.close();
})
.catch(() => {
.catch(() => {
//
loadingInstance.close();
loadingInstance.close();
});
options.loading = false;
}
@ -359,9 +365,9 @@ const handleQueryBom = async (reset = false) => {
const syncToSAPBom = async () => {
options.loading = true;
//
const loadingInstance = ElLoading.service({
text: 'BOM同步中请勿操作',
});
const loadingInstance = ElLoading.service({
text: 'BOM同步中请勿操作',
});
var data = bomxGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步BOM吗`, '提示', {
confirmButtonText: '确定',
@ -381,9 +387,9 @@ const syncToSAPBom = async () => {
})
.catch(() => {
//
loadingInstance.close();
});
loadingInstance.close();
});
options.loading = false;
}
@ -462,9 +468,9 @@ const handleQueryProcessRoute = async (reset = false) => {
const syncToSAPprocessRoute = async () => {
options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '工艺路线同步中,请勿操作',
});
const loadingInstance = ElLoading.service({
text: '工艺路线同步中,请勿操作',
});
var data = processRoutexGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步工艺路线吗?`, '提示', {
confirmButtonText: '确定',
@ -482,9 +488,9 @@ const syncToSAPprocessRoute = async () => {
//
loadingInstance.close();
})
.catch(() => {
.catch(() => {
//
loadingInstance.close();
loadingInstance.close();
});
options.loading = false;
}

View File

@ -49,12 +49,12 @@
<template #row_buttons="{ row }">
<el-tooltip content="同步BOM" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="examineBom(row)"
v-auth="'productManagement/getBOM'" v-if="(row.fld004316=='A'||row.fld004316=='M')&&row.fld004311=='成功'">
v-auth="'productManagement/getBOM'" v-if="(row.fld004316=='A'||row.fld004316=='M')&&row.fld004311=='成功' &&row.fld004312=='N'">
同步BOM </el-button>
</el-tooltip>
<el-tooltip content="工艺路线" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="examineProcessRoute(row)"
v-if="(row.fld004320=='A'||row.fld004320=='M')&&row.fld004311=='成功'">
v-if="(row.fld004320=='A'||row.fld004320=='M')&&row.fld004311=='成功'&&row.fld004312=='N'">
工艺路线 </el-button>
</el-tooltip>

View File

@ -42,12 +42,12 @@
<template #row_buttons="{ row }">
<el-tooltip content="同步BOM" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="getBOM(row)"
v-auth="'projectManagement/getBOM'" v-if="(row.fld004514=='A'||row.fld004514=='M')&&row.fld004509=='成功'">
v-auth="'projectManagement/getBOM'" v-if="(row.fld004514=='A'||row.fld004514=='M')&&row.fld004509=='成功'&& row.fld004510=='N'">
同步BOM </el-button>
</el-tooltip>
<el-tooltip content="工艺路线" placement="top">
<el-button icon="ele-MessageBox" size="small" text="" type="primary" @click="examineProcessRoute(row)"
v-if="(row.fld004517=='A'||row.fld004517=='M')&&row.fld004509=='成功'">
v-if="(row.fld004517=='A'||row.fld004517=='M')&&row.fld004509=='成功'&& row.fld004510=='N'">
工艺路线 </el-button>
</el-tooltip>