commit 20221020

This commit is contained in:
LIUHAO
2022-10-20 13:43:31 +08:00
parent a137256830
commit f96f54dc0a
27 changed files with 3625 additions and 173 deletions

View File

@@ -19,6 +19,7 @@
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=100;pageCurrent=1;searchTable()">查询</el-button>
<el-button type="success" plain icon="el-icon-document-copy" size="small" @click="copyData('form4')">复制</el-button>
</div>
<el-table
v-loading="loading"
@@ -29,12 +30,16 @@
height="740"
center
style="width: 100%">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="TagID" align="center">
<el-table-column width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.row.TagID }}
{{ scope.row.序号 }}
</template>
</el-table-column>
<!-- <el-table-column label="TagID" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.TagID }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="TagName" width="200px" align="center">
<template slot-scope="scope">
{{ scope.row.TagName }}
@@ -45,14 +50,19 @@
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column label="测量位置" align="center">
<el-table-column label="地址" align="center">
<template slot-scope="scope">
{{ scope.row.测量位置 }}
{{ scope.row.变量类型 }} {{ scope.row.变量地址 }}
</template>
</el-table-column>
<!-- <el-table-column label="测量位置" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.测量位置 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="测量项目" align="center">
<template slot-scope="scope">
{{ scope.row.测量项目 }}
{{ scope.row.报警类型 }}
</template>
</el-table-column>
<el-table-column label="变量类型名称" width="300px" align="center">
@@ -86,11 +96,13 @@
<el-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
<el-form-item label="测量项目" prop="measurementItems" style="display: inline-block">
<el-input
v-model="form.measurementItems"
clearable
size="small"
placeholder="测量项目"/>
<el-select v-model="form.measurementItems" placeholder="IP" clearable size="small">
<el-option
v-for="item in alarmType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="变量类型名称" prop="valueName" style="display: inline-block">
<el-input
@@ -105,6 +117,24 @@
<el-button type="primary" size="small" @click="submitAdd1('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible4" title="数据复制" center style="min-height: 200px" width="400px">
<el-form ref="form1" :model="form4" :rules="rules4" label-position="right" label-width="110px">
<el-form-item label="工位号" prop="engineTypeValue" style="display: inline-block">
<el-select v-model="form4.engineTypeValue" placeholder="请选择工位号" size="small">
<el-option
v-for="item in dataType"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff4()">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd4()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -130,7 +160,16 @@ export default {
}
],
valueTypeValue: '9',
alarmType: [],
alarmTypeValue: '',
dialogFormVisible: false,
dialogFormVisible4: false,
form4: {
engineTypeValue: ''
},
rules4: { // 订单下发验证
engineTypeValue: [{ required: true, message: '请选择', trigger: 'blur' }]
},
title: '',
form: {
tagID: '',
@@ -148,7 +187,7 @@ export default {
},
created() {
this.getNumber()
this.searchTable()
this.getAlarmType()
},
methods: {
// 初始化获取产品型号
@@ -163,6 +202,7 @@ export default {
}
}).then(response => {
if (response.data.length) {
this.dataTypeValue = response.data[0].工位号
for (let i = 0; i < response.data.length; i++) {
this.dataType.push({
label: response.data[i].工位号,
@@ -170,6 +210,29 @@ export default {
})
}
}
}).then(() => {
this.searchTable()
})
}, // 初始化获取报警类型
getAlarmType() {
this.alarmType = []
request({
url: '',
method: 'post',
data: {
type: '3',
name: `SELECT [ID], [报警类型] FROM [dbo].[MES_基本变量_报警类型]`
}
}).then(response => {
if (response.data.length) {
// console.log(response.data, 'response.data')
for (let i = 0; i < response.data.length; i++) {
this.alarmType.push({
label: response.data[i].报警类型,
value: response.data[i].ID
})
}
}
})
},
searchTable() {
@@ -238,6 +301,42 @@ export default {
callOff() {
this.dialogFormVisible = false
},
copyData(formName) {
if (this.tableData.length) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.dialogFormVisible4 = true
} else {
this.$message({
message: '暂无可复制的数据!',
type: 'error'
})
}
},
callOff4() {
this.dialogFormVisible4 = false
},
submitAdd4() {
var param = []
param[0] = ['原始工位号', this.dataTypeValue]
param[1] = ['复制工位号', this.form4.engineTypeValue]
var Data = this.CreateData('12', '基础数据_报警变量维护_复制', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '修改成功',
type: 'success'
})
this.dataTypeValue = this.form4.engineTypeValue
this.searchTable()
this.dialogFormVisible4 = false
} else {
this.$message.error('修改失败!')
}
})
this.dialogFormVisible = false
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1