Commit ce96a085 by xin.yang

fix bug

parent d6207731
......@@ -690,13 +690,20 @@ export default {
axios
.request({
url:
"/qms/InspectStandard/GetProductsBySectionId?sectionid=" +
"/acc/SectionProperty/GetMonitorSnProduct?sectionid=" +
stationid,
method: "get",
})
.then((res) => {
if (res.data.ret == 1 && res.data.data.length > 0) {
this.productList = res.data.data;
if (res.data.ret == 1 && res.data.data.id > 0) {
this.productList = [
{
id:res.data.data.id,
name:res.data.data.name,
code:res.data.data.code,
}
];
this.qrcode = res.data.data.sn;
this.product = this.productList[0];
this.initmaterial(this.product.id, stationid);
this.inititems();
......@@ -715,21 +722,6 @@ export default {
this.initproduct(this.station.id);
this.initSn(this.station.id)
},
initSn(sectionid){
if (sectionid > 0) {
axios
.request({
url:
"/acc/SectionProperty/GetSn?sectionId=" + sectionid,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
this.qrcode = res.data.data;
}
});
}
},
productchange(i) {
this.c = i;
this.product = this.productList[i];
......
......@@ -14,6 +14,7 @@ using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Extensions;
using System.Linq;
using Siger.Middlelayer.Repository.Entities;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
namespace Siger.ApiACC.Controllers
{
......@@ -39,8 +40,8 @@ namespace Siger.ApiACC.Controllers
public IActionResult GetSections(string line)
{
var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId);
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid)).
Select(q => q.sectionid).ToList();
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid) &&
q.propertytype == (int)Automation.SectionPropertyEnum.Check).Select(q => q.sectionid).ToList();
var sections = _levelSectionRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && sectionids.Contains(q.id)).
Select(q => new { q.id, q.title }).ToList();
return new ObjectResult(sections);
......@@ -60,10 +61,18 @@ namespace Siger.ApiACC.Controllers
}
[HttpGet]
public IActionResult GetSn(int sectionid)
public IActionResult GetMonitorSnProduct(int sectionid)
{
var monitor = _fixtureMonitor.Get(sectionid);
return new ObjectResult(monitor?.sn ?? "");
var res = new ResponseMonitorSnProduct();
var monitor = _fixtureMonitor.Get(sectionid);
if(monitor != null)
{
res.id = monitor.productId;
res.name = monitor.productName;
res.code = monitor.productCode;
res.sn = monitor.sn;
}
return new ObjectResult(res);
}
}
}
......@@ -164,5 +164,22 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
[Description("不在库内")]
Out =2
}
/// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:清洗5:存储工位
/// </summary>
public enum SectionPropertyEnum
{
[Description("上下料工位")]
UpDownLoad = 1,
[Description("加工工位")]
Machining = 2,
[Description("检验工位")]
Check = 3,
[Description("清洗")]
Clean = 3,
[Description("存储工位")]
Storage = 3,
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment