Commit cd2bd4b3 by yiyu.li

add

parent 8a665cad
......@@ -88,10 +88,12 @@
<span class="infoLabel">状态:</span>
<span class="info">{{
orderDetail.status == 1
? "待上料"
: orderDetail.status == 2
? "运行中"
: "待下料"
? "待上料"
: orderDetail.status == 2
? "运行中"
: orderDetail.status == 3
? "待下料"
: ""
}}</span>
</p>
<p class="flex">
......@@ -176,7 +178,9 @@
? "待上料"
: orderDetail.status == 2
? "运行中"
: "待下料"
: orderDetail.status == 3
? "待下料"
: ""
}}</span>
</p>
<p class="flex">
......
......@@ -10,6 +10,7 @@
class="searchSelect"
:data="datalevel"
:value="leveldata"
@on-change="getSectionId"
></Cascader>
</div>
<div class="searchBtn">
......@@ -20,7 +21,11 @@
@click="search()"
>{{ $t("1001") }}</Button
>
<Button type="primary" class="twoWord" icon="ios-search" @click="exportExcel()"
<Button
type="primary"
class="twoWord"
icon="ios-search"
@click="exportExcel()"
>导出</Button
>
</div>
......@@ -28,33 +33,33 @@
</div>
<div class="divborder">
<div class="stateTitle flex">
<p><span>4</span>生产中</p>
<p><span>4</span>待下料</p>
<p><span>4</span>待上料</p>
<p><span>4</span>不可用</p>
<p><span>{{summary.produceTotal}}</span>生产中</p>
<p><span>{{summary.complateTotal}}</span>待下料</p>
<p><span>{{summary.waittingTotal}}</span>待上料</p>
<p><span>{{summary.disableTotal}}</span>不可用</p>
</div>
<div class="stateWrap">
<template v-for="(item,index) in stateList">
<div class="stateItem" :key="index">
<template v-for="(item, index) in stateList">
<div class="stateItem" :key="index" :style="{background:item.bgc}">
<p class="flex">
<span class="infoLabel">工位:</span>
<span class="info">{{item}}</span>
<span class="info">{{ item.section }}</span>
</p>
<p class="flex">
<span class="infoLabel">产品:</span>
<span class="info"></span>
<span class="info">{{item.product}}</span>
</p>
<p class="flex">
<span class="infoLabel">工装:</span>
<span class="info"></span>
<span class="info">{{item.fixtureName}}</span>
</p>
<p class="flex">
<span class="infoLabel">储位:</span>
<span class="info"></span>
<span class="info">{{item.location}}</span>
</p>
<p class="flex">
<span class="infoLabel">工件:</span>
<span class="info"></span>
<span class="info">{{item.sn}}</span>
</p>
</div>
</template>
......@@ -63,14 +68,14 @@
class="tableClass"
:data="data1"
:columns="columns1"
:max-height="200"
></Table>
<div v-show="show1">
<Table
class="tableClass"
:data="data2"
:columns="columns2"
:max-height="200"
></Table>
</div>
<div v-show="show2">
......@@ -78,7 +83,7 @@
class="tableClass"
:data="data3"
:columns="columns3"
:max-height="200"
></Table>
</div>
</div>
......@@ -94,7 +99,7 @@ export default {
productionLine: [],
leveldata: [], // 产线层级插件所需数据
datalevel: [], // 产线层级选中数据
stateList:[0],
stateList: [0],
columns1: [
{
title: this.$t("1008"),
......@@ -102,22 +107,22 @@ export default {
render: (h, params) => {
return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
params.index+1
);
},
width: 70,
},
{
title: "产线层级",
key: "warehouse",
},
{
title: "设备",
key: "storage_sn",
key: "section",
},
// {
// title: "设备",
// key: "storage_sn",
// },
{
title: "工装编号",
key: "install_sn",
key: "fixtureName",
render: (h, params) => {
return h(
"a",
......@@ -134,11 +139,11 @@ export default {
},
{
title: "产品编号",
key: "workpiece_sn",
key: "product",
},
{
title: "工件编号",
key: "storage_sn",
key: "sn",
render: (h, params) => {
return h(
"a",
......@@ -155,7 +160,7 @@ export default {
},
{
title: "状态",
key: "install_sn",
key: "status",
},
{
title: "最后更新时间",
......@@ -297,13 +302,52 @@ export default {
data3: [],
show2: false,
show1: false,
sectionid:0,
summary:{}
};
},
created() {
this.initlevel();
this.search();
},
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() {
// 初始化产线层级
this.axios
......@@ -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 = {};
this.axios
.request({
......@@ -336,7 +384,7 @@ export default {
this.$Message.error(this.$t(res.data.msg));
}
});
}
},
},
};
</script>
......@@ -347,12 +395,15 @@ export default {
}
.stateWrap {
margin: 20px 10px;
display: flex;
flex-wrap: wrap;
}
.stateItem {
border: 1px solid #000;
width: 200px;
height: 150px;
border: 1px solid #d3d3d3;
width: 300px;
// height: 150px;
padding-left: 10px;
margin: 10px;
p {
height: 30px;
line-height: 30px;
......
......@@ -19,17 +19,10 @@
clearable
filterable
class="searchSelect"
v-model="taskType"
>
</Select>
</div>
<div class="filter">
<label>发起地:</label>
<Select
label-in-value
clearable
filterable
class="searchSelect"
>
<Option :value="1">Load</Option>
<Option :value="2">Unload</Option>
</Select>
</div>
<div class="filter">
......@@ -39,16 +32,40 @@
clearable
filterable
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>
</div>
<div class="filter">
<label>任务编号:</label>
<Input type="text" class="searchInput" />
<Input
type="text"
class="searchInput"
v-model="taskNumber"
/>
</div>
<div class="filter">
<label>工件编号:</label>
<Input type="text" class="searchInput"/>
<Input type="text" class="searchInput" v-model="sn" />
</div>
<div class="filter">
<label>状态:</label>
......@@ -57,7 +74,12 @@
clearable
filterable
class="searchSelect"
v-model="state"
>
<Option :value="1">待执行</Option>
<Option :value="2">执行中</Option>
<Option :value="3">执行完成</Option>
<Option :value="4">取消</Option>
</Select>
</div>
<div class="filter">
......@@ -67,23 +89,30 @@
clearable
filterable
class="searchSelect"
v-model="performType"
>
<Option :value="1">手动执行</Option>
<Option :value="2">自动执行</Option>
</Select>
</div>
<div class="filter">
<label>触发时间:</label>
<DatePicker
type="datetimerange"
type="datetime"
placeholder="Select date"
style="width: 200px"
v-model="startTime"
@on-change="getTime"
></DatePicker>
</div>
<div class="filter">
<label>完成时间:</label>
<DatePicker
type="datetimerange"
type="datetime"
placeholder="Select date"
style="width: 200px"
v-model="endTime"
@on-change="getTime2"
></DatePicker>
</div>
<div class="searchBtn">
......@@ -91,7 +120,7 @@
type="primary"
class="twoWord"
icon="ios-search"
@click="search()"
@click="search(page, pagesize)"
>{{ $t("1001") }}</Button
>
<!-- -->
......@@ -120,7 +149,13 @@
</div>
</div>
<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="pageDirection">
<Page
......@@ -129,6 +164,8 @@
show-elevator
show-sizer
show-total
@on-change="changePage"
@on-page-size-change="handlePageSize"
:page-size-opts="[10, 20, 30, 40, 100]"
></Page>
</div>
......@@ -158,93 +195,197 @@ export default {
width: 70,
},
{
title: "任务清单",
key: "productcode",
title: "任务编号",
key: "taskno",
},
{
title: "产线层级",
key: "productcode",
key: "section",
},
{
title: "触发方",
key: "productcode",
key: "trigger",
},
{
title: "任务类型",
key: "productcode",
},
{
title: "发起地",
key: "productcode",
key: "tasktype",
},
{
title: "工件编号",
key: "productcode",
key: "sn",
},
{
title: "工单编号",
key: "productcode",
key: "ordernumber",
},
{
title: "产品编号",
key: "productcode",
key: "productCode",
},
{
title: "工序编号",
key: "productcode",
key: "routeNo",
},
{
title: "工序",
key: "productcode",
key: "route",
},
{
title: "程序号",
key: "productcode",
key: "program",
},
{
title: "储位位置",
key: "productcode",
key: "location",
},
{
title: "工装编号",
key: "productcode",
key: "fixtureCode",
},
{
title: "动作",
key: "productcode",
key: "action",
},
{
title: "执行类型",
key: "productcode",
key: "actionType",
},
{
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: "触发时间",
key: "productcode",
key: "triggerTime",
},
{
title: "完成时间",
key: "productcode",
key: "complatetime",
},
],
data1: [],
total: 0,
page: 1,
pagesize: 10,
taskType: 0,
from: 0,
productCode: "",
productList: [],
taskNumber: "",
sn: "",
state: 0,
performType: 0,
startTime: "",
endTime: "",
detailobj:{}
};
},
created() {
this.columns1 = this.$time.initTableTitle(this.columns1);
this.initlevel()
this.initlevel();
this.iniproducts();
},
methods: {
search() {},
cancel() {},
manual() {},
exportExcel() {},
search(page, pagesize) {
let params = {
section: this.sectionId,
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() {
// 初始化产线层级
this.axios
......@@ -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 = {};
this.axios
.request({
......@@ -277,7 +442,18 @@ export default {
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>
......
......@@ -587,8 +587,23 @@ export default {
});
}
},
loadExcel() {},
exportEecel() {},
loadExcel() {
// 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));
// }
// });
},
exportEecel() {
},
//工装类型
initFrockType() {
this.axios
......
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