Commit 8eef0c12 authored by kangzhenfei's avatar kangzhenfei

MDC

parent 44a17143
<template>
<div class="dnc_box">
<!-- 数据传输 -->
<DataGrid :columns="columns" ref="grid" :action="action" :data="data" :high="false"></DataGrid>
<!-- 数据传输:action="action" 接口数据 -->
<DataGrid :columns="columns" ref="grid" :data="data" :high="false">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字班次名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="buttons">
<Button type="primary" >新增</Button>
</template>
</DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
<!-- <Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" /> -->
</Modal>
</div>
</template>
<script>
......@@ -9,6 +26,10 @@ export default {
components: {},
data() {
return {
editModal: false,
easySearch: {
keys: { op: 'projectNo', value: null }
},
columns: [
{
key: "projectNo",
......@@ -91,7 +112,7 @@ export default {
notse: "适用于MDF设备"
},
{
projectNo: "1102347890",
projectNo: "12366588",
id:2,
lingNo: "dd4.rt5.991",
lingName: "轴承",
......@@ -105,7 +126,7 @@ export default {
notse: "适用于MDF设备"
},
{
projectNo: "1102347890",
projectNo: "2536898",
id:3,
lingNo: "dd4.rt5.991",
lingName: "轴承",
......@@ -119,7 +140,7 @@ export default {
notse: "适用于MDF设备"
},
{
projectNo: "1102347890",
projectNo: "35653248",
id:4,
lingNo: "dd4.rt5.991",
lingName: "轴承",
......@@ -137,12 +158,16 @@ export default {
},
created() {},
mounted() {
this.loadDuration();
// this.loadDuration();
},
methods: {
edit(rowData){
console.log(rowData)
},
search() {
this.$Message.success("搜索查询")
// this.$refs.grid.reload(this.easySearch)
},
edit(rowData){
console.log(rowData)
},
},
computed: {},
watch: {}
......
<template>
<div>
数据分析表
</div>
</template>
<script>
export default {
}
</script>
<template>
<div class="dnc_box">
设备监控
<div class="mnc_box">
<DataGrid
:columns="columnsDuration"
ref="gridDuration"
:data="data"
:columns="columns"
ref="grid"
:batch="false"
:high="false"
:page="false"
:batch="false"
:easy="false"
:type="typeInfo"
:span="6" :data="comondata"
:set="false"
:height="400"
:tool="false"
></DataGrid>
:gutter="40"
>
<!-- :conditions="easySearch" :action="action" -->
<template slot="easySearch">
<div class="search_box">
<div class="search_item">
<img src="../image/guan.png" alt="">
<div class="top_text">
<p>关机状态</p>
<p><b>123</b></p>
</div>
</div>
<div class="search_item search_item02">
<img src="../image/kong.png" alt="">
<div class="top_text">
<p>空闲状态</p>
<p><b>123</b></p>
</div>
</div>
<div class="search_item search_item03">
<img src="../image/guz.png" alt="">
<div class="top_text">
<p>故障状态</p>
<p><b>123</b></p>
</div>
</div>
<div class="search_item search_item04">
<img src="../image/stay.png" alt="">
<div class="top_text">
<p>运行状态</p>
<p><b>123</b></p>
</div>
</div>
</div>
</template>
<template slot="searchForm">
<!-- <Search /> -->
</template>
<template slot="buttons">
<!-- <Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> -->
<div class="top_btn">
<img src="../image/fenx.png" alt="">
<div class="top_btnt">
<a @click="gotoTable()">查看数据分析图表</a>
</div>
</div>
</template>
<template slot="card" slot-scope="{row}">
<div
class="body" v-for="i of 15" :key="i"
@click="toExecute(row)"
>
<Row class="title-i">
<Col :span="16" class="order-code">
<Ellipsis :text="row.productName+i" :lines="1" tooltip transfer />
</Col>
<Col :span="4" class="order-code">
<a>查看详情</a>
</Col>
<Col :span="4">
<div class="statuBg" :style="tdStyle(row.statu)"></div>
<div class="boxTitle">
<div class="text">
{{row.statu}}
</div>
</div>
</Col>
</Row>
<div class="panel-text">
<Row>
<Col span="8">
<img
:src="getUrl(row.productUrl)"
width="120"
height="120"
:title="row.productUrl"
style="border:#cacbd0 dashed 1px"
/>
</Col>
<Col span="16" class="row">
<p>机床类型:{{row.MachineType}}</p>
<p>机床编码:{{row.MachineCode}}</p>
<p>机床IP:{{row.MachineIp}}</p>
<p>系统信息:{{row.information}}</p>
</Col>
</Row>
</div>
</div>
</template>
</DataGrid>
</div>
</template>
<script>
// import Api from "./api";
// import Search from "./search";
export default {
components: {},
name: "starOrder",
components: {
// Search
},
data() {
return {
columnsDuration: []
// action: Api.index,
easySearch: {
keys: {
op: "mesCode,productName,drawnNumber",
value: null
}
},
downUrl: fileUrlDown,
columns: [
{
title: this.l("mesCode"),
key: "mesCode",
width: 240,
align: "left"
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "taskList.status",
width: 120
},
{
key: "productName",
title: this.l("productName"),
align: "left",
high: true
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
high: true
},
{
key: "quantity",
title: this.l("quantity"),
align: "right",
width: 120,
high: true
},
{
key: "beginTime",
title: this.l("beginTime"),
align: "center",
width: 180,
high: true
},
{
key: "endTime",
title: this.l("endTime"),
align: "center",
width: 180,
high: true
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "edit" },
on: {
click: () =>
this.toExecute(
params.row
)
}
},
"查看"
)
]);
}
}
],
comondata:[
{
productName: "德玛吉235550",
statu: "空闲",
productUrl:"",
MachineType: "机床类型",
MachineCode: "机床编码",
MachineIp: "1231-111-26012",
information: "V-5633-12112",
},{
productName: "德玛吉235536",
statu: "关机",
MachineType: "机床类型",
MachineCode: "机床编码",
MachineIp: "1231-111-26012",
information: "V-5633-12112",
},{
productName: "德玛吉235537",
statu: "故障",
MachineType: "机床类型",
MachineCode: "机床编码",
MachineIp: "1231-111-26012",
information: "V-5633-12112",
},{
productName: "德玛吉235537",
statu: "运行中",
MachineType: "机床类型",
MachineCode: "机床编码",
MachineIp: "1231-111-26012",
information: "V-5633-12112",
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime() //页面当前打开时间
};
},
created() {},
created() {
let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.loadDuration();
this.search();
},
methods: {},
computed: {},
watch: {}
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(
id,
orderId,
executeId,
headid,
routingDetailId,
quantity,
status
) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
quantity: quantity, //派工数量
dispatchStatus: status
}
});
},
tdStyle(val) {
//动态根据状态值加载状态值对应的颜色
// let temDic = this.$store.getters.dictionaryByKey("taskList.status");
let temColor = "#515a6e5c";
if(val=="空闲"){
temColor = "#0DD78D";
}
if(val=="故障"){
temColor = "#FE7777";
}
if(val=="运行中"){
temColor = "#2680EB";
}
// temDic.forEach(data => {
// if (Number(data.code) == val) {
// temColor = data.color;
// }
// });
var style = {};
style["border-top"] = " solid 38px " + temColor;
return style;
},
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
compareTime(dateStart) {
//比较当前时间和计划完成时间
let planEndTime = new Date(dateStart).getTime();
let res = true;
if (this.nowTime - planEndTime > 0) {
res = true;
} else {
res = false;
}
return res;
},
getTimes(dateStart) {
//返回计划完成时间和当前时间的差值
let planEndTime = new Date(dateStart).getTime();
let res = 0;
if (this.nowTime - planEndTime > 0) {
res = 0;
} else {
res = (this.nowTime - planEndTime) / 1000;
}
return res;
},
getStatus(status) {
//根据状态返回未开工、执行中、暂停状态的bool值
let res = true;
if (status == 12 || status == 14 || status == 5) {
res = true;
} else {
res = false;
}
return res;
},
getUrl(url) {
//返回img需要显示的src值
let tempUrl = "";
if (url && url.length > 0) {
tempUrl = this.downUrl + url;
} else {
tempUrl = iconImg + "noPic_product.png";
}
return tempUrl;
},
gotoTable(){
//跳转到数据分析表页面 获取id:this.$route.query.id
this.$router.push("/dncmnc/mnc/analysis"
);
},
l(key) {
let vkey = "order_list" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
\ No newline at end of file
</script>
<style lang="less" scope>
.mnc_box {
height: calc(100vh - 110px);
.table-content .table-tools .btns{
min-width: 300px;
padding: 20px;
.top_btn{
border-left: 1px solid #cccccc;
text-align: left;
height: 100px;
line-height: 100px;
padding-left: 30px;
.top_btnt{
display: inline-block;
padding: 0 0 0 5px;
}
}
}
.search_box{
padding: 20px 0;
// height: 140px;
display: -webkit-flex; /* Safari */
display: flex;
justify-content: space-between;
.search_item{
display: inline-block;
width: calc(20% - 5px);
min-width: 240px;
height: 100px;
background: #515a6e5c;
color: #515A6E;
text-align: center;
padding: 28px 0 0;
border-radius: 4px;
cursor: pointer;
img {
margin: 0 30px 0 0;
}
.top_text {
width: 100px;
height: 50px;
line-height: 24px;
font-size: 16px;
display: inline-block;
b{
font-weight: 800;
}
}
}
.search_item02{
background: #0dd78d30;
color: #0DD78D;
}
.search_item03{
background: #fe777747;
color: #FE7777;
}
.search_item04{
background: #2680eb47;
color: #2680EB;
}
}
.body {
background: white;
border-radius: 4px 0 4px 4px;
border: #cacbd0 solid 1px;
margin-bottom: 30px;
.title-i {
padding: 0 0 0 8px;
height: 38px;
line-height: 38px;
color: #2680eb;
font-size: 14px;
font-weight: bold;
border-bottom: #cacbd0 dotted 1px;
.btn-click {
text-align: right;
a {
color: #fff;
}
a:hover {
color: #249e91;
}
}
}
.panel-text {
padding: 5px 8px;
.row {
color: #666666;
padding-left: 10px;
p {
line-height: 30px;
}
}
}
}
.body:hover {
cursor: pointer;
box-shadow: 0 0 10px #888888;
}
}
.statuBg {
height: 0px;
width: 0;
border-left: solid 50px transparent;
float: right;
margin-right: -1px;
}
.boxTitle {
color: white;
float: right;
margin-top: -42px;
/* Rotate div */
transform: rotate(37deg);
-ms-transform: rotate(37deg); /* Internet Explorer */
-moz-transform: rotate(37deg); /* Firefox */
-webkit-transform: rotate(37deg); /* Safari 和 Chrome */
-o-transform: rotate(37deg); /* Opera */
.text {
font-size: 8px;
font-weight: normal;
}
}
.rowBottom .ivu-col-span-10 {
height: 24px;
padding-right: 10px;
}
</style>
......@@ -25,7 +25,7 @@
<Filed :span="12" name="问题原因">{{entity.reason}}</Filed>
<Filed :span="12" name="责任归属">{{entity.personLiableId}}</Filed>
<Filed :span="24" name="不合格产品">{{entity.productIds}}</Filed>
<Filed :span="24" name="审理单号">{{entity.code}}</Filed>
<!-- <Filed :span="24" name="审理单号">{{entity.code}}</Filed> -->
</Row>
</div>
</template>
......
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