Commit 46b709eb by xin.yang
parents cd96e080 8a665cad
......@@ -29,7 +29,15 @@
:class="{ active: b == index }"
>
<p>{{ item.title }}</p>
<p>{{ item.status == 1 ? "待上料" : "运行中" }}</p>
<p>
{{
item.status == 1
? "待上料"
: orderDetail.status == 2
? "运行中"
: "待下料"
}}
</p>
</div>
</div>
</div>
......@@ -79,7 +87,11 @@
<p class="flex">
<span class="infoLabel">状态:</span>
<span class="info">{{
orderDetail.status
orderDetail.status == 1
? "待上料"
: orderDetail.status == 2
? "运行中"
: "待下料"
}}</span>
</p>
<p class="flex">
......@@ -103,7 +115,9 @@
<Button type="primary" @click="feedReady()"
>准备上料</Button
>
<Button type="primary" @click="installOver()">安装完成</Button>
<Button type="primary" @click="installOver()"
>安装完成</Button
>
</div>
</TabPane>
<TabPane label="下料" :disabled="attr2" name="2"
......@@ -245,7 +259,7 @@ export default {
a: -1,
b: -1,
attr1: false, //上料、下料、上下料
attr2: false, //上料、下料、上下料
attr2: true, //上料、下料、上下料
modal: false,
code: "", //工令单
columns1: [
......@@ -461,7 +475,7 @@ export default {
"/acc/AutomationOperate/CompalateAssemble",
data,
"post"
).thne((res) => {
).then((res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
......
......@@ -106,8 +106,11 @@
class="tableClass"
:columns="columns1"
:data="data1"
highlight-row
@on-row-click="onExpand"
></Table>
<!-- @on-row-click="onExpand" -->
<div class="pageDiv">
<div class="pageDirection">
<Page
......@@ -144,6 +147,7 @@
v-model="parentType"
change-on-select
@on-change="getCategory1"
:disabled="disabled"
></Cascader>
</div>
<div class="filter">
......@@ -155,6 +159,7 @@
filterable
filter-by-label
class="searchSelect"
:disabled="disabled"
>
<Option
v-for="(item, index) in toolingList1"
......@@ -256,6 +261,7 @@ export default {
nonce: localStorage.getItem("nonce"),
sign: localStorage.getItem("sign"),
},
disabled: false,
columns1: [
{
type: "expand",
......@@ -278,8 +284,8 @@ export default {
currentRow,
oldCurrentRow
) => {
this.childObj = {};
this.childObj = currentRow;
console.log(currentRow);
},
},
});
......@@ -428,6 +434,7 @@ export default {
fileurl: "",
filename: "",
UploadAction: this.axios.publicPath + "config/upload/UploadImage",
detailobj: {},
childObj: {},
};
},
......@@ -468,14 +475,25 @@ export default {
});
},
add() {
this.parentType = [];
this.parentId = 0;
this.sonType = [];
this.sonId = 0;
this.remark = "";
this.fileurl = "";
this.filename = "";
this.modal = true;
this.toolingId2 = 0;
this.disabled = false;
if (!this.detailobj.id) {
this.parentType = [];
this.parentId = 0;
} else {
this.parentType = this.detailobj.categoryids;
this.parentId = this.detailobj.categoryid;
this.getToolingList(1);
this.$nextTick(() => {
this.toolingId1 = this.detailobj.fixturetoolid;
});
}
this.type = 1;
},
addPost() {
......@@ -486,21 +504,26 @@ export default {
fileurl: this.fileurl, //url
filename: this.filename, //附件名称
status: 1,
remark: this.remark,
};
if (this.type == 1) {
url = "/acc/FixtureToolsAssembly/Add";
}
if (this.type == 2) {
data.id = this.childObj.id;
url = "/acc/FixtureToolsAssembly/Update";
}
this.request("/acc/FixtureToolsAssembly/Add", data, "post").then(
(res) => {
if (res.data.ret == 1) {
} else {
this.$Message.error(this.$t(res.data.msg));
}
this.request(url, data, "post").then((res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
this.modal = false;
this.detailobj = {};
this.childObj = {};
this.search(this.page, this.pagesize);
} else {
this.$Message.error(this.$t(res.data.msg));
}
);
});
},
edit() {
if (!this.childObj.id) {
......@@ -511,25 +534,33 @@ export default {
this.sonType = this.childObj.categoryids;
this.parentId = this.childObj.parentcategoryid;
this.getToolingList(1);
this.$nextTick(() => {
this.toolingId1 = this.childObj.parentid;
});
this.sonId = this.childObj.categoryid;
this.getToolingList(2);
this.$nextTick(() => {
this.toolingId1 = this.childObj.parentid;
this.toolingId2 = this.childObj.fixturetoolid;
});
this.filename = this.childObj.filename;
this.fileurl = this.childObj.fileurl;
this.remark = this.childObj.remark;
this.disabled = true;
this.type = 2;
this.modal = true;
},
dele() {
return;
if (this.detailobj.id === undefined || this.detailobj.id === null) {
this.$Message.error(this.$t("1017"));
return false;
} else {
// if (!this.childObj.id) {
// this.$Message.error("请选择子工装信息");
// return false;
// }
var params = {
id: this.detailobj.id,
id: this.childObj.id ? this.childObj.id : this.detailobj.id,
};
this.$Modal.confirm({
title: this.$t("1018"),
......@@ -540,7 +571,7 @@ export default {
onOk: () => {
this.axios
.request({
url: "/acc/FixtureToolsProduct/Delete",
url: "/acc/FixtureToolsAssembly/Delete",
params,
method: "get",
})
......@@ -586,9 +617,6 @@ export default {
this.parentType.length > 0
? this.parentType[this.parentType.length - 1]
: 0;
console.log(val);
console.log(this.parentId);
if (this.parentId != 0) {
this.getToolingList(1);
......@@ -607,7 +635,6 @@ export default {
getToolingList(index) {
let id = 0;
id = index == 1 ? this.parentId : this.sonId;
console.log(index);
this.request(
"/acc/FixtureTools/GetFixtureToolList?categoryid=" + id,
"",
......@@ -643,6 +670,14 @@ export default {
},
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
console.log(currentRow);
// this.data1.forEach((item, i) => {
// //这个循环是为了每次只能展开一个,其他自动收起,不需要可以去掉
// i !== currentRow.index ? (this.data1[currentRow.index]._expanded = false) : "";
// });
// this.data1[currentRow.index]._expanded = !this.data1[currentRow.index]._expanded;
// this.data1.sort();
// this.childObj = {};
},
onExpand(row, index) {
this.detailobj = row;
......@@ -652,8 +687,12 @@ export default {
i !== index ? (this.data1[i]._expanded = false) : "";
});
this.data1[index]._expanded = !this.data1[index]._expanded;
if (this.data1[index]._expanded == false) {
this.detailobj = {};
this.toolingId1 = 0;
this.childObj = {};
}
this.data1.sort();
this.childObj = {};
},
handlePageSize(value) {
this.page = 1;
......
......@@ -197,6 +197,15 @@ namespace Siger.ApiACC.Controllers
taskObj.status = request.status;
_automationTaskList.Update(taskObj);
var machineStatus = _automationMachineStatus.Get(f => f.section == taskObj.sectionid);
if (machineStatus==null)
{
throw new BadRequestException(AccEnum.MachineDisable);
}
machineStatus.status = request.status;
_automationMachineStatus.Update(machineStatus);
if (_unitOfWork.Commit() <= 0)
{
throw new BadRequestException(CommonEnum.Fail);
......@@ -266,6 +275,12 @@ namespace Siger.ApiACC.Controllers
return;
}
var updownDic= stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation);
var uploadStations = updownDic.Select(f => f.dval).ToList();
/* 自动任务创建只有CNC 设备;排除上料设备(手动任务) */
var dictClean = stationDicts.FirstOrDefault(s=>s.dkey==DictKeyValConst.CleanStation);
if (dictClean==null)
{
......@@ -287,7 +302,7 @@ namespace Siger.ApiACC.Controllers
if (cleanMachine.status == (int)Automation.MachineStatus.Complated)
{
Logger.WriteLineInfo($"AutoProcess 有清洗机完成,创建清洗剂Task");
CreateTask(cleanMachine,TaskActionType.Unload, TaskAction.Step_QXJ_LK);
CreateTask(cleanMachine,TaskActionType.Unload, TaskAction.Step_QXJ_LK, uploadStations);
return; //完成当前任务 退出
}
}
......@@ -298,7 +313,7 @@ namespace Siger.ApiACC.Controllers
if (freeMachine != null)
{
Logger.WriteLineInfo($"AutoProcess 普通空闲,创建普通设备上料Task");
CreateTask(freeMachine,TaskActionType.Load ,TaskAction.Step_LK_JGZX);
CreateTask(freeMachine,TaskActionType.Load ,TaskAction.Step_LK_JGZX, uploadStations);
return; //完成当前任务 退出
}
//优先级3:其他设备下料 (加工中心 ->立库)
......@@ -308,7 +323,7 @@ namespace Siger.ApiACC.Controllers
if (fullMachine != null && cleanMachine.status==(int)Automation.MachineStatus.Waiting)
{
Logger.WriteLineInfo($"AutoProcess 普通空闲,创建普通设备下料Task ");
CreateTask(fullMachine,TaskActionType.Unload, TaskAction.Step_JGZX_QXJ);
CreateTask(fullMachine,TaskActionType.Unload, TaskAction.Step_JGZX_QXJ, uploadStations);
return; //完成当前任务 退出
}
......@@ -322,8 +337,15 @@ namespace Siger.ApiACC.Controllers
/// <param name="machineStatus"></param>
/// <param name="actionType"></param>
/// <param name="taskAction"></param>
void CreateTask(siger_automation_machine_status machineStatus,TaskActionType actionType, TaskAction taskAction)
/// <param name="uploadStations"></param>
void CreateTask(siger_automation_machine_status machineStatus,TaskActionType actionType, TaskAction taskAction,List<string>uploadStations)
{
var uploadPostion= uploadStations.Exists(f => f.Contains(machineStatus.section.ToString()));
if (uploadPostion)
{
Logger.WriteLineInfo($"CreateTask 上料料工站 无需自动创建任务 ");
return;
}
//j检查工装监控状态
var monitor = _automationFixtureMonitor.Get(f => f.section == machineStatus.section);
if (monitor==null)
......
......@@ -261,7 +261,7 @@ namespace Siger.ApiACC.Controllers
productcode=plan.product_code,
processid=0,
programnumber="",
remark ="手动任务",
remark ="手动任务-准备上料",
});
......@@ -301,9 +301,14 @@ namespace Siger.ApiACC.Controllers
if (_unitOfWork.Commit() > 0)
{
Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_LK_SXLW)}");
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
/// <summary>
......@@ -337,9 +342,50 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(AccEnum.TaskProcessing);
}
//创建 安装完成动作
var monitor = _automationFixtureMonitor.Get(f => f.projectId == ProjectId && f.section == assemble.section);
if (monitor==null)
{
throw new BadRequestException(AccEnum.MonitorNotfound);
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
_automationTaskList.Insert(new siger_automation_task_list
{
no = taskNo,
action = Automation.TaskAction.Step_SXLW_LK,
actiontype = Automation.ExcueType.None,
triggertime = DateTime.MinValue,
tasktype = Automation.TaskActionType.Load,
operater = UserId,
operatetime = DateTime.Now,
sectionid = assemble.section,
send = 0,
status = 1,
completetime = DateTime.MinValue,
trigger = Automation.TaskTrigerType.Manual,
projectId = ProjectId,
productid = 0,
sn = monitor.sn,
ordercode = monitor.ordernumber,
fixtureguid = monitor.fixtureguid,
locationid = monitor.locationId,
productcode = monitor.productCode,
processid = 0,
programnumber = "",
remark = "手动任务-安装完成",
return new ObjectResult(1);
});
if (_unitOfWork.Commit() > 0)
{
Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}");
return new ObjectResult(CommonEnum.Succefull);
}
else
{
throw new BadRequestException(CommonEnum.Fail);
}
}
/// <summary>
/// 准备下料
......
......@@ -332,7 +332,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("设备正在空闲中")]
MachineOnFree,
[Description("设备已经生产完成")]
MachineProCompalate
MachineProCompalate,
[Description("该设备当前无工装状态")]
MonitorNotfound
}
public enum SeriNumCfg
......
......@@ -105,7 +105,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join q in _context.siger_automation_fixture_tools_product on p.product_code equals q.productcode
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
join l in _context.siger_automation_location on t.guid equals l.fixturetools
where q.projectId == projectId && d.OrderNumber == ordernumber && q.status == (int)RowState.Valid && t.status == (int)RowState.Valid
where q.projectId == projectId && d.OrderNumber == ordernumber
&& q.status == (int)RowState.Valid && t.status == (int)RowState.Valid && l.status==(int)RowState.Valid
select new ResponsePlanlFixtureInfo
{
OrderNumber = ordernumber,
......
......@@ -36,14 +36,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
var date = DateTime.Now;
var lable = date.ToString(UnixTimeHelper.DateTimeFormatYmd)+date.Hour + date.Minute + date.Second + date.Millisecond;
var lableUnix = UnixTimeHelper.GetNow();
var radon = new Random().Next(1000, 9999);
if (trigerType== TaskTrigerType.Auto)
{
return $"A{radon}T{lable}";
return $"A{lableUnix}R{radon}T{lable}";
}else
{
return $"M{radon}T{lable}";
return $"M{lableUnix}R{radon}T{lable}";
}
}
......
......@@ -10,7 +10,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <summary>
/// 是否能创建任务
/// 上下料时候是否能创建任务
/// </summary>
/// <param name="projectId"></param>
/// <param name="section"></param>
......
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