Commit a0ae7a04 by jiawei.su
parents 94f65e88 e76452b5
...@@ -720,6 +720,7 @@ export default { ...@@ -720,6 +720,7 @@ export default {
'9000495': '未找到工装信息', '9000495': '未找到工装信息',
'9000496': 'ID重复', '9000496': 'ID重复',
'9000497': '父级和子级不能相同', '9000497': '父级和子级不能相同',
'9000498': '该类型绑定了工装,不能删除',
'9100000': 'Departments cannot be empty', '9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty', '9100001': 'Position cannot be empty',
......
...@@ -747,6 +747,7 @@ export default { ...@@ -747,6 +747,7 @@ export default {
'9000495': '未找到工装信息', '9000495': '未找到工装信息',
'9000496': 'ID重复', '9000496': 'ID重复',
'9000497': '父级和子级不能相同', '9000497': '父级和子级不能相同',
'9000498': '该类型绑定了工装,不能删除',
'9100000': '部门不能为空', '9100000': '部门不能为空',
......
...@@ -91,7 +91,9 @@ ...@@ -91,7 +91,9 @@
? "待上料" ? "待上料"
: orderDetail.status == 2 : orderDetail.status == 2
? "运行中" ? "运行中"
: "待下料" : orderDetail.status == 3
? "待下料"
: ""
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
...@@ -176,7 +178,9 @@ ...@@ -176,7 +178,9 @@
? "待上料" ? "待上料"
: orderDetail.status == 2 : orderDetail.status == 2
? "运行中" ? "运行中"
: "待下料" : orderDetail.status == 3
? "待下料"
: ""
}}</span> }}</span>
</p> </p>
<p class="flex"> <p class="flex">
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
class="searchSelect" class="searchSelect"
:data="datalevel" :data="datalevel"
:value="leveldata" :value="leveldata"
@on-change="getSectionId"
></Cascader> ></Cascader>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
...@@ -20,7 +21,11 @@ ...@@ -20,7 +21,11 @@
@click="search()" @click="search()"
>{{ $t("1001") }}</Button >{{ $t("1001") }}</Button
> >
<Button type="primary" class="twoWord" icon="ios-search" @click="exportExcel()" <Button
type="primary"
class="twoWord"
icon="ios-search"
@click="exportExcel()"
>导出</Button >导出</Button
> >
</div> </div>
...@@ -28,33 +33,33 @@ ...@@ -28,33 +33,33 @@
</div> </div>
<div class="divborder"> <div class="divborder">
<div class="stateTitle flex"> <div class="stateTitle flex">
<p><span>4</span>生产中</p> <p><span>{{summary.produceTotal}}</span>生产中</p>
<p><span>4</span>待下料</p> <p><span>{{summary.complateTotal}}</span>待下料</p>
<p><span>4</span>待上料</p> <p><span>{{summary.waittingTotal}}</span>待上料</p>
<p><span>4</span>不可用</p> <p><span>{{summary.disableTotal}}</span>不可用</p>
</div> </div>
<div class="stateWrap"> <div class="stateWrap">
<template v-for="(item,index) in stateList"> <template v-for="(item, index) in stateList">
<div class="stateItem" :key="index"> <div class="stateItem" :key="index" :style="{background:item.bgc}">
<p class="flex"> <p class="flex">
<span class="infoLabel">工位:</span> <span class="infoLabel">工位:</span>
<span class="info">{{item}}</span> <span class="info">{{ item.section }}</span>
</p> </p>
<p class="flex"> <p class="flex">
<span class="infoLabel">产品:</span> <span class="infoLabel">产品:</span>
<span class="info"></span> <span class="info">{{item.product}}</span>
</p> </p>
<p class="flex"> <p class="flex">
<span class="infoLabel">工装:</span> <span class="infoLabel">工装:</span>
<span class="info"></span> <span class="info">{{item.fixtureName}}</span>
</p> </p>
<p class="flex"> <p class="flex">
<span class="infoLabel">储位:</span> <span class="infoLabel">储位:</span>
<span class="info"></span> <span class="info">{{item.location}}</span>
</p> </p>
<p class="flex"> <p class="flex">
<span class="infoLabel">工件:</span> <span class="infoLabel">工件:</span>
<span class="info"></span> <span class="info">{{item.sn}}</span>
</p> </p>
</div> </div>
</template> </template>
...@@ -63,14 +68,14 @@ ...@@ -63,14 +68,14 @@
class="tableClass" class="tableClass"
:data="data1" :data="data1"
:columns="columns1" :columns="columns1"
:max-height="200"
></Table> ></Table>
<div v-show="show1"> <div v-show="show1">
<Table <Table
class="tableClass" class="tableClass"
:data="data2" :data="data2"
:columns="columns2" :columns="columns2"
:max-height="200"
></Table> ></Table>
</div> </div>
<div v-show="show2"> <div v-show="show2">
...@@ -78,7 +83,7 @@ ...@@ -78,7 +83,7 @@
class="tableClass" class="tableClass"
:data="data3" :data="data3"
:columns="columns3" :columns="columns3"
:max-height="200"
></Table> ></Table>
</div> </div>
</div> </div>
...@@ -94,7 +99,7 @@ export default { ...@@ -94,7 +99,7 @@ export default {
productionLine: [], productionLine: [],
leveldata: [], // 产线层级插件所需数据 leveldata: [], // 产线层级插件所需数据
datalevel: [], // 产线层级选中数据 datalevel: [], // 产线层级选中数据
stateList:[0], stateList: [0],
columns1: [ columns1: [
{ {
title: this.$t("1008"), title: this.$t("1008"),
...@@ -102,22 +107,22 @@ export default { ...@@ -102,22 +107,22 @@ export default {
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", "span",
params.index + (this.page - 1) * this.pagesize + 1 params.index+1
); );
}, },
width: 70, width: 70,
}, },
{ {
title: "产线层级", title: "产线层级",
key: "warehouse", key: "section",
},
{
title: "设备",
key: "storage_sn",
}, },
// {
// title: "设备",
// key: "storage_sn",
// },
{ {
title: "工装编号", title: "工装编号",
key: "install_sn", key: "fixtureName",
render: (h, params) => { render: (h, params) => {
return h( return h(
"a", "a",
...@@ -134,11 +139,11 @@ export default { ...@@ -134,11 +139,11 @@ export default {
}, },
{ {
title: "产品编号", title: "产品编号",
key: "workpiece_sn", key: "product",
}, },
{ {
title: "工件编号", title: "工件编号",
key: "storage_sn", key: "sn",
render: (h, params) => { render: (h, params) => {
return h( return h(
"a", "a",
...@@ -155,7 +160,7 @@ export default { ...@@ -155,7 +160,7 @@ export default {
}, },
{ {
title: "状态", title: "状态",
key: "install_sn", key: "status",
}, },
{ {
title: "最后更新时间", title: "最后更新时间",
...@@ -297,13 +302,52 @@ export default { ...@@ -297,13 +302,52 @@ export default {
data3: [], data3: [],
show2: false, show2: false,
show1: false, show1: false,
sectionid:0,
summary:{}
}; };
}, },
created() { created() {
this.initlevel(); this.initlevel();
this.search();
}, },
methods: { methods: {
search() {}, search() {
// 初始化产线层级
this.axios
.request({
url: "/acc/AutomationState/GetStationMonitor?section="+this.sectionid,
method: "get",
})
.then((res) => {
const arr = [];
if (res.data.ret == 1) {
console.log(res.data.data);
// this.stateList = res.data.data.dts;
let arr = [];
arr = res.data.data.dts;
arr.forEach(ele => {
let bgc = '';
if (ele.enable == 0) {
bgc = 'red'
}
if(ele.status ==1){
bgc = '#2db7f5'
}
if(ele.status ==2){
bgc = '#ff9900'
}
if(ele.status ==3){
bgc = '#19be6b'
}
ele.bgc = bgc
});
this.stateList = arr;
this.data1 = arr;
this.summary = res.data.data.sum;
console.log(this.summary);
}
});
},
initlevel() { initlevel() {
// 初始化产线层级 // 初始化产线层级
this.axios this.axios
...@@ -320,7 +364,11 @@ export default { ...@@ -320,7 +364,11 @@ export default {
} }
}); });
}, },
exportExcel(){ getSectionId(val){
this.leveldata = val;
this.sectionid = this.leveldata.length>0?this.leveldata[this.leveldata.length-1]:0;
},
exportExcel() {
let data = {}; let data = {};
this.axios this.axios
.request({ .request({
...@@ -336,7 +384,7 @@ export default { ...@@ -336,7 +384,7 @@ export default {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
}); });
} },
}, },
}; };
</script> </script>
...@@ -347,12 +395,15 @@ export default { ...@@ -347,12 +395,15 @@ export default {
} }
.stateWrap { .stateWrap {
margin: 20px 10px; margin: 20px 10px;
display: flex;
flex-wrap: wrap;
} }
.stateItem { .stateItem {
border: 1px solid #000; border: 1px solid #d3d3d3;
width: 200px; width: 300px;
height: 150px; // height: 150px;
padding-left: 10px; padding-left: 10px;
margin: 10px;
p { p {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
......
...@@ -19,17 +19,10 @@ ...@@ -19,17 +19,10 @@
clearable clearable
filterable filterable
class="searchSelect" class="searchSelect"
v-model="taskType"
> >
</Select> <Option :value="1">Load</Option>
</div> <Option :value="2">Unload</Option>
<div class="filter">
<label>发起地:</label>
<Select
label-in-value
clearable
filterable
class="searchSelect"
>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
...@@ -39,16 +32,40 @@ ...@@ -39,16 +32,40 @@
clearable clearable
filterable filterable
class="searchSelect" class="searchSelect"
v-model="productCode"
>
<Option
v-for="(item, index) in productList"
:value="item.id"
:key="index"
:label="
item.name +
'#' +
item.code +
'#' +
item.drawingcode
"
>{{
item.name +
"#" +
item.code +
"#" +
item.drawingcode
}}</Option
> >
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>任务编号:</label> <label>任务编号:</label>
<Input type="text" class="searchInput" /> <Input
type="text"
class="searchInput"
v-model="taskNumber"
/>
</div> </div>
<div class="filter"> <div class="filter">
<label>工件编号:</label> <label>工件编号:</label>
<Input type="text" class="searchInput"/> <Input type="text" class="searchInput" v-model="sn" />
</div> </div>
<div class="filter"> <div class="filter">
<label>状态:</label> <label>状态:</label>
...@@ -57,7 +74,12 @@ ...@@ -57,7 +74,12 @@
clearable clearable
filterable filterable
class="searchSelect" class="searchSelect"
v-model="state"
> >
<Option :value="1">待执行</Option>
<Option :value="2">执行中</Option>
<Option :value="3">执行完成</Option>
<Option :value="4">取消</Option>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
...@@ -67,23 +89,30 @@ ...@@ -67,23 +89,30 @@
clearable clearable
filterable filterable
class="searchSelect" class="searchSelect"
v-model="performType"
> >
<Option :value="1">手动执行</Option>
<Option :value="2">自动执行</Option>
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>触发时间:</label> <label>触发时间:</label>
<DatePicker <DatePicker
type="datetimerange" type="datetime"
placeholder="Select date" placeholder="Select date"
style="width: 200px" style="width: 200px"
v-model="startTime"
@on-change="getTime"
></DatePicker> ></DatePicker>
</div> </div>
<div class="filter"> <div class="filter">
<label>完成时间:</label> <label>完成时间:</label>
<DatePicker <DatePicker
type="datetimerange" type="datetime"
placeholder="Select date" placeholder="Select date"
style="width: 200px" style="width: 200px"
v-model="endTime"
@on-change="getTime2"
></DatePicker> ></DatePicker>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
...@@ -91,7 +120,7 @@ ...@@ -91,7 +120,7 @@
type="primary" type="primary"
class="twoWord" class="twoWord"
icon="ios-search" icon="ios-search"
@click="search()" @click="search(page, pagesize)"
>{{ $t("1001") }}</Button >{{ $t("1001") }}</Button
> >
<!-- --> <!-- -->
...@@ -120,7 +149,13 @@ ...@@ -120,7 +149,13 @@
</div> </div>
</div> </div>
<div class="divborder newTableDiv"> <div class="divborder newTableDiv">
<Table class="tableClass" :columns="columns1" :data="data1"></Table> <Table
class="tableClass"
:columns="columns1"
:data="data1"
@on-current-change="handleRowChange"
highlight-row
></Table>
<div class="pageDiv"> <div class="pageDiv">
<div class="pageDirection"> <div class="pageDirection">
<Page <Page
...@@ -129,6 +164,8 @@ ...@@ -129,6 +164,8 @@
show-elevator show-elevator
show-sizer show-sizer
show-total show-total
@on-change="changePage"
@on-page-size-change="handlePageSize"
:page-size-opts="[10, 20, 30, 40, 100]" :page-size-opts="[10, 20, 30, 40, 100]"
></Page> ></Page>
</div> </div>
...@@ -158,93 +195,197 @@ export default { ...@@ -158,93 +195,197 @@ export default {
width: 70, width: 70,
}, },
{ {
title: "任务清单", title: "任务编号",
key: "productcode", key: "taskno",
}, },
{ {
title: "产线层级", title: "产线层级",
key: "productcode", key: "section",
}, },
{ {
title: "触发方", title: "触发方",
key: "productcode", key: "trigger",
}, },
{ {
title: "任务类型", title: "任务类型",
key: "productcode", key: "tasktype",
},
{
title: "发起地",
key: "productcode",
}, },
{ {
title: "工件编号", title: "工件编号",
key: "productcode", key: "sn",
}, },
{ {
title: "工单编号", title: "工单编号",
key: "productcode", key: "ordernumber",
}, },
{ {
title: "产品编号", title: "产品编号",
key: "productcode", key: "productCode",
}, },
{ {
title: "工序编号", title: "工序编号",
key: "productcode", key: "routeNo",
}, },
{ {
title: "工序", title: "工序",
key: "productcode", key: "route",
}, },
{ {
title: "程序号", title: "程序号",
key: "productcode", key: "program",
}, },
{ {
title: "储位位置", title: "储位位置",
key: "productcode", key: "location",
}, },
{ {
title: "工装编号", title: "工装编号",
key: "productcode", key: "fixtureCode",
}, },
{ {
title: "动作", title: "动作",
key: "productcode", key: "action",
}, },
{ {
title: "执行类型", title: "执行类型",
key: "productcode", key: "actionType",
}, },
{ {
title: "状态", title: "状态",
key: "productcode", key: "status",
render: (h, params) => {
let str = "";
switch (params.row.status) {
case 1:
str = "待执行";
break;
case 2:
str = "执行中";
break;
case 3:
str = "执行完成";
break;
case 4:
str = "取消";
break;
}
return h('div',str)
},
}, },
{ {
title: "触发时间", title: "触发时间",
key: "productcode", key: "triggerTime",
}, },
{ {
title: "完成时间", title: "完成时间",
key: "productcode", key: "complatetime",
}, },
], ],
data1: [], data1: [],
total: 0, total: 0,
page: 1, page: 1,
pagesize: 10, pagesize: 10,
taskType: 0,
from: 0,
productCode: "",
productList: [],
taskNumber: "",
sn: "",
state: 0,
performType: 0,
startTime: "",
endTime: "",
detailobj:{}
}; };
}, },
created() { created() {
this.columns1 = this.$time.initTableTitle(this.columns1); this.columns1 = this.$time.initTableTitle(this.columns1);
this.initlevel() this.initlevel();
this.iniproducts();
}, },
methods: { methods: {
search() {}, search(page, pagesize) {
cancel() {}, let params = {
manual() {}, section: this.sectionId,
exportExcel() {}, tasktype: this.taskType,
productCode: this.productCode,
sn: this.sn,
status: this.status,
actionType: this.performType,
triggertime: this.startTime,
complatetime: this.endTime,
page: page,
pageSize: pagesize,
};
this.axios
.request({
url: "/acc/AutomationState/GetTasklist",
params,
method: "get",
})
.then((res) => {
const arr = [];
if (res.data.ret == 1) {
console.log(res.data.data);
this.data1 = res.data.data.data;
}
});
},
cancel() {
if (this.detailobj.status !=1) {
this.$Message.error("该任务清单状态不能取消");
return false;
}
return
let data = {
section: this.sectionid,
};
this.request(
// "/acc/AutomationOperate/CompalateAssemble",
data,
"post"
).then((res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
manual() {
if (this.detailobj.actiontype != 1) {
this.$Message.error("该任务清单不能手动执行");
return false;
}
let data = {
section: this.sectionid,
};
this.request(
// "/acc/AutomationOperate/CompalateAssemble",
data,
"post"
).then((res) => {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
exportExcel() {
// this.axios.request({
// url: "/config/Download/GetTemplate?name=StorageLocation",
// method: "get",
// })
// .then((res) => {
// if (res.data.ret === 1) {
// window.location.href =
// this.axios.publicPath + "" + res.data.data;
// } else {
// this.$Message.error(this.$t(res.data.msg));
// }
// });
},
initlevel() { initlevel() {
// 初始化产线层级 // 初始化产线层级
this.axios this.axios
...@@ -261,7 +402,31 @@ export default { ...@@ -261,7 +402,31 @@ export default {
} }
}); });
}, },
exportExcel(){ iniproducts() {
var params = {
name: "",
count: 1000000,
};
this.axios
.request({
url: "/config/ProjectProduct/GetProductsByCode",
params,
method: "get",
})
.then((res) => {
let data = res.data.data;
if (res.data.ret === 1) {
this.productList = res.data.data;
}
});
},
getTime(val) {
this.startTime = val;
},
getTime2(val) {
this.endTime = val;
},
exportExcel() {
let data = {}; let data = {};
this.axios this.axios
.request({ .request({
...@@ -277,7 +442,18 @@ export default { ...@@ -277,7 +442,18 @@ export default {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
}); });
} },
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
},
handlePageSize(value) {
this.pagesize = value;
this.data1 = this.search(this.page, this.pagesize);
},
changePage(value) {
this.page = value;
this.data1 = this.search(this.page, this.pagesize);
},
}, },
}; };
</script> </script>
......
...@@ -254,7 +254,7 @@ export default { ...@@ -254,7 +254,7 @@ export default {
//导入方法 //导入方法
action: action:
this.axios.publicPath + this.axios.publicPath +
"wms/Upload/Submit?templateName=StorageLocation", "acc/Upload/Submit?templateName=FixtureToolsAssmeblyTemplate",
headers: { headers: {
token: localStorage.getItem("token"), token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"), timestamp: localStorage.getItem("timestamp"),
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
:class="table_scrollx ? 'collection_table' : ''" :class="table_scrollx ? 'collection_table' : ''"
style=" style="
width: 100%; width: 100%;
float: left;
height: 100%; height: 100%;
padding-left: 5px; padding-left: 5px;
" "
...@@ -353,7 +352,6 @@ ...@@ -353,7 +352,6 @@
<div <div
style=" style="
width: 870px; width: 870px;
float: left;
height: 100%; height: 100%;
padding-left: 5px; padding-left: 5px;
overflow-y: scroll; overflow-y: scroll;
......
...@@ -401,18 +401,23 @@ namespace Siger.ApiACC.Controllers ...@@ -401,18 +401,23 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
var details = GetSonCategoryList(entity.guid, categorys); var details = GetSonCategoryList(entity.guid, categorys).ToList();
var detailIds = details.Select(q => q.id).Distinct().ToList(); details.Add(entity);
var detailGuids = details.Select(q => q.guid).Distinct().ToList();
if (_toolsRepository.GetList(q => q.projectId == ProjectId && detailGuids.Contains(q.category)).Any())
{
throw new BadRequestException(RequestEnum.CategoryBindFixtureToolData);
}
var delDetails = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && var delDetails = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid &&
detailIds.Contains(q.id)).ToList(); detailGuids.Contains(q.guid)).ToList();
foreach (var detail in delDetails) foreach (var detail in delDetails)
{ {
detail.status = (int)RowState.Invalid; detail.status = (int)RowState.Invalid;
_toolsCategoryRepository.Update(detail); _toolsCategoryRepository.Update(detail);
} }
entity.status = (int)RowState.Invalid;
_toolsCategoryRepository.Update(entity);
if(_unitOfWork.Commit() > 0) if(_unitOfWork.Commit() > 0)
{ {
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
...@@ -427,7 +432,7 @@ namespace Siger.ApiACC.Controllers ...@@ -427,7 +432,7 @@ namespace Siger.ApiACC.Controllers
{ {
var query = from c in sections where c.parent == parentId select c; var query = from c in sections where c.parent == parentId select c;
return query.ToList().Concat(query.ToList().SelectMany(t => GetSonCategoryList(t.parent, sections))); return query.ToList().Concat(query.ToList().SelectMany(t => GetSonCategoryList(t.guid, sections)));
} }
[HttpGet] [HttpGet]
......
...@@ -1476,5 +1476,8 @@ namespace Siger.Middlelayer.Common ...@@ -1476,5 +1476,8 @@ namespace Siger.Middlelayer.Common
[Description("父级和子级不能相同")] [Description("父级和子级不能相同")]
ParentSonSame, ParentSonSame,
[Description("该类型绑定了工装,不能删除")]
CategoryBindFixtureToolData,
} }
} }
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