Commit 4d2772de authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 18eb33e9 7667d67e
...@@ -429,7 +429,7 @@ export default { ...@@ -429,7 +429,7 @@ export default {
let v = conditions[u].value; let v = conditions[u].value;
let op = conditions[u].op; let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == "Range") { if (op == "Range"&&Array.isArray(v)) {
let times = []; let times = [];
v.map(u => { v.map(u => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
...@@ -437,7 +437,7 @@ export default { ...@@ -437,7 +437,7 @@ export default {
} }
}); });
v = times.join(","); v = times.join(",");
} else if (op.indexOf("In") > -1) { } else if (op.indexOf("In") > -1&&Array.isArray(v)) {
v = v.join(","); v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
...@@ -544,6 +544,14 @@ export default { ...@@ -544,6 +544,14 @@ export default {
}, },
height() { height() {
this.tableHeight = this.height; this.tableHeight = this.height;
},
"columns.length"(){
this.columns.forEach(u => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
} }
} }
}; };
......
<template> <template>
<div> <div>数据分析表
数据分析表 <Echart1 ></Echart1>
</div> </div>
</template> </template>
<script> <script>
import Echart1 from './compose/echart1'
export default { export default {
components: {
Echart1,
},
data() {
return {
// echarts选项
option: {
title: {
text: '折线图堆叠'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['在用率', '运行率', '故障率', '停机率'],
right: '50px' ,
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
},
yAxis: {
type: 'value'
},
series: [
{
name: '在用率',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '运行率',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '故障率',
type: 'line',
stack: '总量',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '停机率',
type: 'line',
stack: '总量',
data: [320, 332, 301, 334, 390, 330, 320]
},
]
},
} };
},
methods: {},
};
</script> </script>
<template>
<div>
<div id="myChart" style="width:1200px;height:410px;margin:0 auto;top: -40px;"></div>
</div>
</template>
<script>
export default {
name: 'Echart1',
data() {
return {
disabled: false
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
loadEchart() {
// 基于准备好的dom,初始化echarts实例
var myChart = this.$echarts.init(document.getElementById('myChart'))
var option = {
title: {
text:
'Total: 115 SampleSize: 5 Groups: 23 Max: 0.966 Min: 0.91 Dev: 0.022003 CPK: 1.34 PPK: 1.36 Ca: 0.1 Cp: 1.49 Pp: 1.51',
subtext: '',
textStyle: {
fontWeight: 'normal',
fontSize:'12px',
color: '#515A6E' //legend颜色
},
left: 'center',
top: 'bottom'
},
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: '#739ADD' // 0% 处的颜色
},
{
offset: 1,
color: '#739ADD' // 100% 处的颜色
}
],
global: false // 缺省为 false
},
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false
}
},
xAxis: {
type: 'category',
data: [
'2019',
'2020',
'2021',
'2022',
'2023',
'2024',
'2025',
'2026',
'2027',
'2028',
'2029',
'2030'
]
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} ‰'
}
},
series: [
{
data: [1.6, 2.8, 3.2, 1.6, 0.2, 4.7, 1.5, 4.9, 2.5, 5.4, 6.2, 1.5],
type: 'line',
markLine: {
data: [
{
type: 'max',
label: {
formatter: '2020目标值 6 ‰'
},
lineStyle: {
//警戒线的样式 ,虚实 颜色
type: 'dashed',
color: '#0B5813',
width: 2
}
},
{
type: 'min',
label: {
formatter: '2030目标值 0.2 ‰'
},
lineStyle: {
//警戒线的样式 ,虚实 颜色
type: 'dashed',
color: '#E99224',
width: 2
}
}
]
}
}
]
}
// 绘制图表
myChart.setOption(option)
}
},
mounted() {
this.loadEchart()
}
}
</script>
...@@ -124,32 +124,32 @@ export default { ...@@ -124,32 +124,32 @@ export default {
productName: "德玛吉235550", productName: "德玛吉235550",
statu: "空闲", statu: "空闲",
productUrl:"shebei.png", productUrl:"shebei.png",
MachineType: "机床类型", MachineType: "V1-256-16331",
MachineCode: "机床编码", MachineCode: "JCBM-06221",
MachineIp: "1231-111-26012", MachineIp: "1231-111-26012",
information: "V-5633-12112", information: "V-5633-12112",
},{ },{
productName: "德玛吉235536", productName: "德玛吉235536",
statu: "关机", statu: "关机",
productUrl:"shebei.png", productUrl:"shebei.png",
MachineType: "机床类型", MachineType: "V1-256-16332",
MachineCode: "机床编码", MachineCode: "JCBM-06222",
MachineIp: "1231-111-26012", MachineIp: "1231-111-26012",
information: "V-5633-12112", information: "V-5633-12112",
},{ },{
productName: "德玛吉235537", productName: "德玛吉235537",
statu: "故障", statu: "故障",
productUrl:"shebei.png", productUrl:"shebei.png",
MachineType: "机床类型", MachineType: "V1-256-16333",
MachineCode: "机床编码", MachineCode: "JCBM-06223",
MachineIp: "1231-111-26012", MachineIp: "1231-111-26012",
information: "V-5633-12112", information: "V-5633-12112",
},{ },{
productName: "德玛吉235537", productName: "德玛吉235537",
statu: "运行中", statu: "运行中",
productUrl:"shebei.png", productUrl:"shebei.png",
MachineType: "机床类型", MachineType: "V1-256-16334",
MachineCode: "机床编码", MachineCode: "JCBM-06224",
MachineIp: "1231-111-26012", MachineIp: "1231-111-26012",
information: "V-5633-12112", information: "V-5633-12112",
}, },
......
.set_card{
padding: 30px 30px 0;
.set_card_box{
border: 1px solid #CACBD0;
border-radius: 4px;
margin: 0 0 30px 0;
.set_top{
text-align: center;
background: #267feb42;
line-height: 38px;
color: #2680EB;
font-weight: bold;
}
.set_card_body{
padding: 10px;
.set_img{
min-width: 150px;
min-height: 120px;
text-align: center;
}
.bao_code{
line-height: 32px;
font-size: 16px;
font-weight: bold;
border-right: 1px solid #ccc;
padding: 30px 0 0 0;
margin: 0 10px 0 0;
}
.set_masage{
min-height: 125px;
}
}
}
}
\ No newline at end of file
<style lang="less" scoped>
@import "./mnc.less";
</style>
<template> <template>
<div> <div>
单台设备监控页面 <a class="back_href" @click="goView">
<Icon type="ios-undo-outline" size="24" />返回设备监控
</a>
<div class="set_card">
<Row :gutter="30">
<Col span="6">
<div class="set_card_box">
<p class="set_top">设备属性</p>
<div class="set_card_body">
<Row>
<Col span="10">
<img class="set_img" src="../image/shebei.png" alt=""/>
</Col>
<Col span="14">
<div class="set_masage">
<p>机床名称:德玛吉235537</p>
<p>机床类型:V1-256-16334</p>
<p>机床编码:JCBM-06224</p>
<p>机床IP:1231-111-26012</p>
<p>系统信息:V-5633-12112</p>
</div>
</Col>
</Row>
</div>
</div>
</Col>
<Col span="6">
<div class="set_card_box">
<p class="set_top">当前任务信息</p>
<div class="set_card_body">
<div class="set_masage">
<p>当前程序号:德玛吉235537</p>
<p>零件号:V1-256-16334</p>
<p>加工工序号:JCBM-06224</p>
<p>当前任务号:RWBH-0617-001</p>
<p>工步卡号:GBKH-222-2011</p>
</div>
</div>
</div>
</Col>
<Col span="12">
<div class="set_card_box">
<p class="set_top">设备报警信息</p>
<div class="set_card_body">
<Row>
<Col span="5">
<div class="set_img bao_code">
<p>报警码</p>
<p>13366133</p>
</div>
</Col>
<Col span="19">
<div class="set_masage">
<p><b>报警原因:</b></p>
<p>磨损所致。 异常操作所致。 非法改变其功能所致。 超负荷使用。 设计上潜在不良因素。 维护手法欠佳。
设备故障一般是指设备失去或降低其规定功能的事件或现象,表现为设备生产运行异常,
指设备的某些零件失去原有的精度或性能,使设备不能正常运行、技术性能降低,致使设备中断生产或效率</p>
</div>
</Col>
</Row>
</div>
</div>
</Col>
</Row>
<Row :gutter="30">
<Col span="6" class="set_bottom">
<div class="set_card_box">
<p class="set_top">设备状态</p>
<div class="set_card_body">
<div class="set_img">
<img src="../image/guz.png" alt="">
<p>故障</p>
</div>
<div class="set_masage">
<p>当前状态开始时间:</p>
<p class="time_bg">11:45:05</p>
<p>当前状态持续时间:</p>
<p class="time_bg">11:55:25</p>
</div>
</div>
</div>
<div class="set_card_box">
<p class="set_top">加工状态统计</p>
<div class="center">
图表
</div>
</div>
</Col>
<Col span="18">
<div class="set_card_box">
<p class="set_top">加工状态实时信息</p>
<div class="center">
图表
</div>
</div>
</Col>
</Row>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){
return{
};
},
methods:{
goView(){
//返回设备监控页面 获取id:this.$route.query.id
this.$router.push("/dncmnc/mnc");
},
},
} }
</script> </script>
\ No newline at end of file
...@@ -150,16 +150,33 @@ export default { ...@@ -150,16 +150,33 @@ export default {
{ {
title: "属性名称", title: "属性名称",
key: "title", key: "title",
align: "center",
slot: "title" slot: "title"
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width:150
}, },
{ {
title: "备注", title: "备注",
key: "note", key: "note",
<<<<<<< HEAD
align: "center", align: "center",
slot: "note", slot: "note",
width: "150" width: "150"
=======
slot: "note"
>>>>>>> 7667d67eff74481dc10aa4e1489266881dc30077
}, },
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
...@@ -175,21 +192,27 @@ export default { ...@@ -175,21 +192,27 @@ export default {
width: "150" width: "150"
}, },
{ {
title: "是否必填", title: "必填",
key: "required", key: "required",
align: "center", align: "center",
slot: "required" slot: "required",
width:80
}, },
{ {
title: "是否唯一属性", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique" slot: "isUnique",
width:80
}, },
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
<<<<<<< HEAD
=======
width: 80,
>>>>>>> 7667d67eff74481dc10aa4e1489266881dc30077
align: "center" align: "center"
} }
], ],
...@@ -228,6 +251,7 @@ export default { ...@@ -228,6 +251,7 @@ export default {
if (r.result) { if (r.result) {
var arr = r.result; var arr = r.result;
this.checkList = arr.filter(function(item) { this.checkList = arr.filter(function(item) {
item.mid=item.id;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item; return item;
}); });
...@@ -254,7 +278,15 @@ export default { ...@@ -254,7 +278,15 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId=0;
this.checkList.map(u=>{
if(u.mid>maxId){
maxId=u.mid;
}
})
let obj = { let obj = {
mid:maxId+1,
field:"c"+maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: "",
......
<template> <template>
<div> <div class="p10">
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12"> <!-- <Col :span="12">
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<Col :span="24" style="margin-bottom:20px;"> <Col :span="24" style="margin-bottom:20px;">
<Button type="primary" long @click="addNew" class="mt10">添加</Button> <Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col> </Col>
<Col :span="24" style="text-align: right;"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
...@@ -148,15 +148,21 @@ export default { ...@@ -148,15 +148,21 @@ export default {
{ {
title: "属性名称", title: "属性名称",
key: "title", key: "title",
align: "center",
slot: "title" slot: "title"
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width:150
}, },
{ {
title: "备注", title: "备注",
key: "note", key: "note",
align: "center",
slot: "note" slot: "note"
}, },
<<<<<<< HEAD
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
...@@ -169,22 +175,33 @@ export default { ...@@ -169,22 +175,33 @@ export default {
align: "center", align: "center",
slot: "unitName" slot: "unitName"
}, },
=======
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
>>>>>>> 7667d67eff74481dc10aa4e1489266881dc30077
{ {
title: "是否必填", title: "必填",
key: "required", key: "required",
align: "center", align: "center",
slot: "required" slot: "required",
width:80
}, },
{ {
title: "是否唯一属性", title: "唯一",
key: "isunique", key: "isUnique",
align: "center", align: "center",
slot: "isunique" slot: "isUnique",
width:80
}, },
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
width: 100, width: 80,
align: "center" align: "center"
} }
], ],
...@@ -218,9 +235,12 @@ export default { ...@@ -218,9 +235,12 @@ export default {
fieldValue: this.nodeInfo.id fieldValue: this.nodeInfo.id
} }
]; ];
Api.listTable({ conditions: conditions }).then(r => { Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => {
if (r.result) { if (r.result) {
console.log(r); console.log(r);
r.result.map(u=>{
u.mid=u.id;
})
this.checkList = r.result; this.checkList = r.result;
} }
}); });
...@@ -239,8 +259,15 @@ export default { ...@@ -239,8 +259,15 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let arr = this.$u.clone(this.checkList); let maxId=0;
this.checkList.map(u=>{
if(u.mid>maxId){
maxId=u.mid;
}
})
let obj = { let obj = {
mid:maxId+1,
field:"c"+maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: "",
...@@ -249,10 +276,9 @@ export default { ...@@ -249,10 +276,9 @@ export default {
fieldType: 3, fieldType: 3,
categoryId: 0, categoryId: 0,
action: 1, action: 1,
add: 0 add: 0 //新增标识
}; };
arr.push(obj); this.checkList.push(obj);
this.checkList = arr;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok" /> <MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok" />
</Content> </Content>
</Layout> </Layout>
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false"> <Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<component <component
:is="detail" :is="detail"
:eid="curId" :eid="curId"
...@@ -133,10 +133,14 @@ export default { ...@@ -133,10 +133,14 @@ export default {
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [] conditions: [],sortBy:'id',isDesc:false
}; };
Api.pagedSlecet(data).then(r => { Api.pagedSlecet(data).then(r => {
this.cityList = r.result.items; this.cityList = r.result.items;
this.downName=this.cityList[0].name;
this.model8=this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId);
}); });
}, },
......
...@@ -33,6 +33,28 @@ ...@@ -33,6 +33,28 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input> <Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<div>
<h4>扩展属性</h4>
</div>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]" ></Input>
<InputNumber v-if="li.dataType==1||li.dataType==2" v-model="entity[li.field]" class="w100"></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==4" v-model="entity[li.filed]" ></Input>
<DatePicker v-if="li.dataType==5" v-model="entity[li.field]" type="date" :placeholder="'选择'+li.title" ></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]" ></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]" ></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]" ></Input>
</FormItem>
</Col>
<Col :span="24">
<div v-html="entity"></div>
</Col>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -53,6 +75,7 @@ export default { ...@@ -53,6 +75,7 @@ export default {
entity: { entity: {
code: 0, code: 0,
status: 0, status: 0,
codeRuleId:this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {}, customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
...@@ -61,40 +84,47 @@ export default { ...@@ -61,40 +84,47 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }]
} },
fileds:[]//扩展属性
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { created() {
// this.tableData(); this.initFiled();
}, },
methods: { methods: {
// tableData() { initFiled() {
// let conditions = [ let conditions = [
// { {
// conditionalType: "In", conditionalType: "Equal",
// fieldName: "fieldType", fieldName: "categoryId",
// fieldValue: "1,2" fieldValue: this.nodeInfo.rootCategoryId
// }, }
// { ];
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: "0"
// }
// ];
// Api.listTable({ conditions: conditions }).then(r => { Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => {
// if (r.result) { if (r.result) {
// var arr = r.result; this.fileds = r.result.filter(function(item) {
// this.checkList = arr.filter(function(item) { item.span=12;
// delete item["id"]; if(item.dataType>4){
// return item; item.span=24
// }); }
// } delete item["id"];
// }); return item.fieldType!=1;
// }, });
this.fileds.map(u=>{
let v='';
if(u.dataType==1||u.dataType==2){
v=0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity,u.filed,v)
})
}
});
},
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
//新增的删除,直接删 //新增的删除,直接删
......
...@@ -11,14 +11,17 @@ export default { ...@@ -11,14 +11,17 @@ export default {
list(params){ list(params){
return Api.post(`${systemUrl}/category/list`,params); return Api.post(`${systemUrl}/category/list`,params);
}, },
listTable(params){
return Api.post(`${systemUrl}/custompropertydefinition/list`,params);
},
get(params){ get(params){
return Api.get(`${systemUrl}/material/get`,params); return Api.get(`${systemUrl}/material/get`,params);
}, },
create(params){ create(params){
return Api.post(`${systemUrl}/material/create`,params); return Api.post(`${systemUrl}/material/createnew`,params);
}, },
update(params){ update(params){
return Api.post(`${systemUrl}/material/update`,params); return Api.post(`${systemUrl}/material/updatenew`,params);
}, },
delete(id) { delete(id) {
return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}}); return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}});
......
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
entity: { entity: {
id: this.eid, id: this.eid,
code: 0, code: 0,
codeRuleId:this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {}, customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
......
...@@ -107,10 +107,14 @@ export default { ...@@ -107,10 +107,14 @@ export default {
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [] conditions: [],sortBy:'id',isDesc:false
}; };
Api.pagedSlecet(data).then(r => { Api.pagedSlecet(data).then(r => {
this.cityList = r.result.items; this.cityList = r.result.items;
this.downName=this.cityList[0].name;
this.model8=this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId);
}); });
}, },
// chnangeClick(val){ // chnangeClick(val){
......
<template> <template>
<div class="master-data"> <div class="master-data">
<DataGrid <DataGrid
:columns="columns" :columns="cols"
ref="grid" ref="grid"
:conditions="easySearch" :conditions="easySearch"
:action="action" :action="action"
...@@ -136,12 +136,25 @@ export default { ...@@ -136,12 +136,25 @@ export default {
key: "description", key: "description",
title: "描述", title: "描述",
align: "left" align: "left"
},
{
key: "creationTime",
title: "创建时间",
hide:false,
align: "left"
},
{
key: "creatorUserId",
title: "创建人",
hide:false,
align: "left",
type:"user"
}, },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
width: 260, width: 150,
align: "left", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
h( h(
...@@ -171,7 +184,8 @@ export default { ...@@ -171,7 +184,8 @@ export default {
]); ]);
} }
} }
] ], //基础咧
cols: [] //
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -179,6 +193,11 @@ export default { ...@@ -179,6 +193,11 @@ export default {
}, },
created() { created() {
this.tableHeight = window.innerHeight - 220; this.tableHeight = window.innerHeight - 220;
if (this.nodeInfo.rootCategoryId == 0) {
this.cols = this.columns;
} else {
this.initCols();
}
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
...@@ -205,6 +224,43 @@ export default { ...@@ -205,6 +224,43 @@ export default {
search() { search() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
initCols() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.rootCategoryId
}
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
var items = r.result.filter(u => {
return !this.columns.some(p => {
return p.key == u.field;
})&&u.dataType!=5;
});
this.cols=this.$u.clone(this.columns);
let extra= items.map(u=>{
var col={
key:u.field,
title:u.title
};
if(u.dataType==3){
col.code=u.note;
}
return col
})
this.cols= this.cols.concat(extra);
var action=this.cols.splice(this.columns.length-1,1);
this.cols.push(this.columns[this.columns.length-1]);
}
});
},
add() { add() {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
...@@ -273,6 +329,10 @@ export default { ...@@ -273,6 +329,10 @@ export default {
watch: { watch: {
nodeInfo: { nodeInfo: {
handler(newName, oldName) { handler(newName, oldName) {
console.log("ovo",newName,oldName)
if(newName.rootCategoryId){
this.initCols();
}
if (newName.categoryId) { if (newName.categoryId) {
this.easySearch.categoryId.value = newName.ids; this.easySearch.categoryId.value = newName.ids;
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
......
...@@ -262,9 +262,17 @@ export default { ...@@ -262,9 +262,17 @@ export default {
}, },
columns12: [ columns12: [
{ title: "序号", type: "index", width: "70", align: "center" }, { title: "序号", type: "index", width: "70", align: "center" },
{ title: "参数名称", key: "check_params" }, { title: "参数名称", key: "check_params" , tooltip: true },
{ title: "检验类型", key: "check_type" }, { title: "检验类型", key: "inspect_type" ,render(h,params) {
{ title: "汇报类型", key: "fillintype" },
return h("state",{
props:{
code:"QC.checktype",
value:params.row.inspect_type
}
})
},},
{ title: "汇报类型", key: "fillintype_str",width:100 },
{ title: "标准指标", key: "standard" }, { title: "标准指标", key: "standard" },
{ title: "生产要求", key: "production_requirement", tooltip: true }, { title: "生产要求", key: "production_requirement", tooltip: true },
{ title: "检测内容", key: "check_content", tooltip: true }, { title: "检测内容", key: "check_content", tooltip: true },
...@@ -340,11 +348,13 @@ export default { ...@@ -340,11 +348,13 @@ export default {
{ {
title: "是否拍照", title: "是否拍照",
key: "isPhotograph", key: "isPhotograph",
width:100,
slot: "isPhotograph" slot: "isPhotograph"
}, },
{ {
title: "模板", title: "模板",
key: "qualityTemplate", key: "qualityTemplate",
width:80,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div",
...@@ -659,7 +669,6 @@ export default { ...@@ -659,7 +669,6 @@ export default {
this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList); this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList);
}, },
selfchecklistcheck(index, e) { selfchecklistcheck(index, e) {
alert(e);
this.recorddata[index].selfchecklist.checkstatus = e; this.recorddata[index].selfchecklist.checkstatus = e;
this.recorddata[index].selfchecklist.fill_in_content = e ? "1" : "0"; this.recorddata[index].selfchecklist.fill_in_content = e ? "1" : "0";
}, },
......
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