Commit 6d235900 by xin.yang
parents 9f5b644a b96d84c0
......@@ -5,7 +5,7 @@
<div class="choose">
<p class="selectTitle">
1.请选择生产线
<span class="red">*</span>
<!-- <span class="red">*</span> -->
</p>
<div class="row">
<p
......@@ -19,17 +19,14 @@
</p>
</div>
<div class="choose">
<p class="selectTitle">
2.上下料工位
<span class="red">*</span>
</p>
<p class="selectTitle">2.上下料工位</p>
<div class="row">
<div
:key="index"
class="options2"
v-for="(item, index) in stationList"
@click="change(index)"
:class="{ active: a == index }"
@click="change2(index)"
:class="{ active: b == index }"
>
<p>{{ item.title }}</p>
<p>{{ item.status == 1 ? "待上料" : "运行中" }}</p>
......@@ -37,18 +34,19 @@
</div>
</div>
<div class="choose">
<p class="selectTitle">
3.操作
<span class="red">*</span>
</p>
<p class="selectTitle">3.操作</p>
<Tabs type="card">
<TabPane label="上料" :disabled="attr1">
<div class="filter">
<label style="font-size: 16px"
>上料信息:</label
>
<Input type="text" class="searchInput"
style="width: 300px"/>
<Input
type="text"
class="searchInput"
style="width: 300px"
@keyup.enter="getWorkOrderInfo()"
/>
</div>
<div class="row">
<p class="flex">
......@@ -149,8 +147,16 @@
</p>
</div>
<div>
<Button type="primary">准备上料</Button>
<Button type="primary">安装完成</Button>
<Button
type="primary"
@click="feedReady()"
>准备下料</Button
>
<Button
type="primary"
@click="installOver()"
>拆卸完成</Button
>
</div>
</div>
</div></TabPane
......@@ -199,6 +205,7 @@ export default {
productionLine: [],
stationList: [],
a: -1,
b: -1,
attr1: false, //上料、下料、上下料
attr2: false, //上料、下料、上下料
modal: false,
......@@ -209,26 +216,26 @@ export default {
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
params.index + 1
);
},
width: 70,
},
{
title: "仓库",
key: "warehouse",
key: "wavehouse",
},
{
title: "储位编号",
key: "storage_sn",
key: "locationcode",
},
{
title: "工装编号",
key: "install_sn",
key: "code",
},
{
title: "工件编号",
key: "workpiece_sn",
key: "materialsn",
},
],
data1: [],
......@@ -239,22 +246,22 @@ export default {
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
params.index+ 1
);
},
width: 70,
},
{
title: "储位编号",
key: "storage_sn",
key: "locationcode",
},
{
title: "工装编号",
key: "install_sn",
key: "code",
},
{
title: "工件编号",
key: "workpiece_sn",
key: "materialsn",
},
],
data2: [],
......@@ -262,6 +269,7 @@ export default {
},
created() {
this.getProLine();
this.getStorages();
},
mounted() {
// this.getStations()
......@@ -303,11 +311,22 @@ export default {
this.a = i;
this.getStations(this.productionLine[i].id);
},
change2(index) {
this.b = index;
let status = this.stationList[index].status;
if (status == 1) {
this.attr2 = true;
}
},
//获取储位
getStorages() {
this.request("", "", "")
this.request("/acc/AutomationLocation/GetLocationList", "", "get")
.then((res) => {
console.log(res.data.data);
if (res.data.ret == 1) {
this.data1 = res.data.data;
this.data2 = res.data.data;
}
})
.catch((err) => {
......@@ -325,6 +344,33 @@ export default {
console.log(err);
});
},
feedReady() {
// 准备上料
let data = {
section: 13,
code: "234324",
};
this.request("/acc/AutomationOperate/Loading", data, "post").thne((res) => {
if (res.data.ret == 1) {
}
});
},
installOver() {
// 安装完成
let data = {
section: 13
};
this.request("", data, "post").thne(
(res) => {
if (res.data.ret == 1) {
}
}
);
},
request(url, data, type) {
if (type == "get") {
return this.axios
......
......@@ -15,7 +15,17 @@
</Select>
</div>
<div class="filter">
<label>夹具类型:</label>
<label>工装编号:</label>
<Select
label-in-value
clearable
filterable
class="searchSelect"
>
</Select>
</div>
<div class="filter">
<label>状态:</label>
<Select
label-in-value
clearable
......@@ -112,8 +122,9 @@
export default {
data() {
return {
columns1: [
columns1:[
{
type: "index2",
title: this.$t("1008"),
key: "xuhao",
render: (h, params) => {
......@@ -122,13 +133,90 @@ export default {
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: 70,
},
{
title: this.$t("100089"),
key: "productcode",
minWidth: 150,
title:'工装类型',
key:'category'
},
{
title:'管理类型',
key:'managetype',
render:(h,params)=>{
let str = '';
if(params.row.managetype===1){
str = '单件';
}else if(params.row.managetype===2){
str = '批次';
}
return h('span',str);
}
},
{
title:'工装料号',
key:'partnumber'
},
{
title:'工装名称',
key:'name'
},
{
title:'工装编号',
key:'code'
},
{
title:'规格型号',
key:'specification'
},
{
title:'数量',
key:'number'
},
{
title:'状态',
key:'status',
render:(h,params)=>{
let str = '';
if(params.row.status===1){
str = '可用';
}else{
str = '停用';
}
return h('span',str);
}
},
{
title:'备注',
key:'remark'
},
{
title:'附件',
key:'filename',
render:(h,params)=>{
return h('span',{
style:{
color:'#2b85e4',
cursor:'pointer'
},
on:{
click:()=>{
let name = params.row.filename;
let url = params.row.fileurl;
if(url){
this.downFile(url,name);
}
}
}
},params.row.filename);
}
},
{
title:'维护人',
key:'updator'
},
{
title:'维护时间',
key:'updatetime'
}
],
data1: [],
total: 0,
......
......@@ -35,7 +35,7 @@
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
:format="['xlsx','xls']"
>
<Button
type="primary"
......@@ -275,7 +275,7 @@ export default {
detailobj:{},
addmodal:false,
type:0,//1添加 2编辑
parentType:[],//父级类型
parentType:[],//工装类型
parentTypeid:'',
frockTypename:'',//工装类型名称
addmtype:1,//管理类型
......@@ -346,20 +346,6 @@ export default {
this.parentType = value;
}
},
//获取工装列表
getFrocks(){
// this.axios.request({
// url: "/fms/accountInfo/frockList",
// method: "get",
// })
// .then((res) => {
// this.frockList = [];
// let data = res.data.data;
// if (res.data.ret == 1&&Array.isArray(data)&&data.length) {
// this.frockList = data;
// }
// });
},
tosearch(){
this.page = 1;
this.pagesize = 10;
......@@ -367,7 +353,7 @@ export default {
},
search(toexcel){
let params = {
category:this.frockType,//工装类型id
category:this.frockTypeid,//工装类型id
code:this.frockcode,
name:this.frockname,
state:this.status, //0停用 1可用
......@@ -385,7 +371,7 @@ export default {
if(toexcel === 1){
if (res.data.ret === 1) {
window.location.href =
axios.publicPath + "" + res.data.data;
this.axios.publicPath + "" + res.data.data;
} else {
this.$Message.error(this.$t(res.data.msg));
}
......@@ -518,7 +504,7 @@ export default {
return false;
}
},
handleSuccess (res,file) {
handleSuccess1 (res,file) {
this.spinShow = false;
if (res.ret == 1) {
this.$Message.success(this.$t("100378"));
......@@ -528,7 +514,8 @@ export default {
this.$Message.error(this.$t(res.msg+''));
}
},
handleError(){
handleError1(){
this.spinShow = false;
this.$Message.error(this.$t("600512") + "!");
},
delfile(){
......
......@@ -21,7 +21,7 @@
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
:format="['xlsx','xls']"
>
<Button
type="primary"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -28,7 +28,7 @@
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
:format="['xlsx','xls']"
>
<Button
type="primary"
......
......@@ -33,7 +33,7 @@
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
:format="['xlsx','xls']"
>
<Button
type="primary"
......
......@@ -28,8 +28,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationMachineStatus _automationMachineStatus;
private readonly ISigerProjectMachineAttributionRepository _sigerProjectMachineAttribution;
private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IProductPlanDetails _planDetails;
private readonly IProductPlanRepository _productPlan;
public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList)
public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList,
IProductPlanDetails planDetails,IProductPlanRepository productPlan)
{
_unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection;
......@@ -37,6 +40,8 @@ namespace Siger.ApiACC.Controllers
_automationMachineStatus = automationMachineStatus;
_sigerProjectMachineAttribution = sigerProjectMachineAttribution;
_automationTaskList = automationTaskList;
_planDetails = planDetails;
_productPlan = productPlan;
}
/// <summary>
......@@ -163,7 +168,20 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.TaskProcessing);
}
var plandts = _planDetails.Get(f => f.projectId == ProjectId && f.OrderNumber == loading.code);
if (plandts==null)
{
throw new BadRequestException(CncEnum.PlanHasExist);
}
var plan = _productPlan.Get(f => f.id == plandts.PlanId);
if (plan == null)
{
throw new BadRequestException(CncEnum.PlanHasExist);
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
var sn = _automationTaskList.CreateRandonSn(plan.product_code);
_automationTaskList.Insert(new siger_automation_task_list
{
......@@ -180,6 +198,9 @@ namespace Siger.ApiACC.Controllers
completetime=DateTime.MinValue,
trigger= Automation.TaskTrigerType.Manual,
projectId=ProjectId,
productid=plan.product_id,
sn=sn,
ordercode=plandts.OrderNumber,
remark="手动任务",
});
......
......@@ -15,6 +15,7 @@ namespace Siger.Middlelayer.Common.Helpers
public const string DateTimeFormatYmd = "yyyyMMdd";
public const string TimeFormat = "HH:mm:ss";
public const string DateTimeFormatYYmmdd = "yyMMdd";
/// <summary>
/// unix time to date-->yyyyMMdd
......
......@@ -165,5 +165,7 @@ namespace Siger.Middlelayer.AccRepository
public DbSet<siger_automation_machine_status> siger_automation_machine_status { get; set; }
public DbSet<siger_automation_produce_history> siger_automation_produce_history { get; set; }
public DbSet<siger_automation_fixture_tools_monitor> siger_automation_fixture_tools_moniter { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Entities
{
public class siger_automation_fixture_tools_monitor:AccEntityBase
{
/// <summary>
/// 工装ID
/// </summary>
public int fixtureId { get; set; }
/// <summary>
/// 当前工站ID
/// </summary>
public int section { get; set; }
/// <summary>
/// 当前Sn
/// </summary>
public string sn { get; set; }
/// <summary>
/// 工序ID
/// </summary>
public int route { get; set; }
/// <summary>
/// 工序描述
/// </summary>
public string routedesc { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime updatetime { get; set; }
}
}
......@@ -26,7 +26,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary>
/// 工件ID
/// </summary>
public int materialid { get; set; }
public string sn { get; set; }
/// <summary>
/// 工单号
/// </summary>
......
using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface;
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Repositories
{
internal class AutomationFixtureMonitor : AccRepositoryBase<siger_automation_fixture_tools_monitor>, IAutomationFixtureMonitor
{
public AutomationFixtureMonitor(ApiAccDbContext context) : base(context)
{
}
}
}
......@@ -2,6 +2,7 @@
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface;
using Siger.Middlelayer.Common.Helpers;
......@@ -45,5 +46,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories
return $"M{radon}T{lable}";
}
}
public string CreateRandonSn(string productCode)
{
var date = DateTime.Now;
var serinum = date.DayOfYear+date.Hour + date.Minute + date.Second + date.Millisecond;
var randon = new Random().Next(1000, 9999);
return $"{productCode}{date.ToString(UnixTimeHelper.DateTimeFormatYmd)}{serinum}{randon}";
}
}
}
using Siger.Middlelayer.AccRepository.Entities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureMonitor : IAccRepositoryBase<siger_automation_fixture_tools_monitor>
{
}
}
......@@ -16,5 +16,11 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <param name="section"></param>
/// <returns></returns>
bool CanTask(int projectId,int section);
/// <summary>
/// 创建随机工件号码 SN
/// </summary>
/// <returns></returns>
string CreateRandonSn(string productCode);
}
}
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