commit 20220825

This commit is contained in:
LIUHAO
2022-08-25 16:43:34 +08:00
parent cd26a75a0b
commit 0a551baa42
16 changed files with 2316 additions and 105 deletions

View File

@@ -0,0 +1,192 @@
import request from '@/utils/request'
import state from '@/store'
import router from '@/router'
// 获取工位 表1
export function getTableData1() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '3',
name: 'SELECT * FROM [基础数据_设备工位点检表]inner join dbo.基础数据_点检类型名称 on [基础数据_设备工位点检表].点检表类型 = 基础数据_点检类型名称.点检表类型流水号'
}
})
}
// 点检类型 表2
export function getTableData2() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '3',
name: 'select * from 基础数据_点检类型名称'
}
})
}
// 点检内容 表3
export function getTableData3(num) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '3',
name: `select * from 基础数据_点检内容 where 点检表类型 = ${num}`
}
})
}
// 表1 编辑
export function editType(num1, num2) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `update [基础数据_设备工位点检表] set 点检表类型 = ${num1} where ID = ${num2}`
}
})
}
export function confirmEdit1(num1, num2) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `update [基础数据_点检类型名称] set 点检表类型名称 = '${num1}' where 点检表类型流水号 = ${num2}`
}
})
}
export function confirmEdit2(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `update 基础数据_点检内容 set 保养周期 = ${num1} ,保养项目 = '${num2}' where ID = ${num3}`
}
})
}
export function openDelete1(num1) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `delete 基础数据_点检类型名称 where 点检表类型流水号 = ${num1}`
}
})
}
export function selectCount(num1) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '3',
name: `SELECT 工位号 FROM [基础数据_设备工位点检表] where 点检表类型 = ${num1}`
}
})
}
export function openDelete2(num1) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `delete 基础数据_点检内容 where ID = ${num1}`
}
})
}
export function submit1(num1) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: `insert into 基础数据_点检类型名称 (点检表类型名称) values ('${num1}')`
}
})
}
export function submit2(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '4',
name: ` declare @id int = 0
SELECT top 1 @id = ID FROM [dbo].基础数据_点检内容 order by ID desc
set @id = @id + 1
insert into 基础数据_点检内容 (点检任务编号,点检表类型,保养项目,保养周期) values (@id,${num1},'${num2}',${num3})`
}
})
}
export function exportOut(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '3',
name: `SELECT *
,case when [FN1] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN1]) else '' end as [姓名1]
,case when [FN2] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN2]) else '' end as [姓名2]
,case when [FN3] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN3]) else '' end as [姓名3]
,case when [FN4] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN4]) else '' end as [姓名4]
,case when [FN5] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN5]) else '' end as [姓名5]
,case when [FN6] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN6]) else '' end as [姓名6]
,case when [FN7] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN7]) else '' end as [姓名7]
,case when [FN8] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN8]) else '' end as [姓名8]
,case when [FN9] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN9]) else '' end as [姓名9]
,case when [FN10] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN10]) else '' end as [姓名10]
,case when [FN11] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN11]) else '' end as [姓名11]
,case when [FN12] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN12]) else '' end as [姓名12]
,case when [FN13] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN13]) else '' end as [姓名13]
,case when [FN14] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN14]) else '' end as [姓名14]
,case when [FN15] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN15]) else '' end as [姓名15]
,case when [FN16] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN16]) else '' end as [姓名16]
,case when [FN17] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN17]) else '' end as [姓名17]
,case when [FN18] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN18]) else '' end as [姓名18]
,case when [FN19] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN19]) else '' end as [姓名19]
,case when [FN20] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN20]) else '' end as [姓名20]
,case when [FN21] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN21]) else '' end as [姓名21]
,case when [FN22] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN22]) else '' end as [姓名22]
,case when [FN23] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN23]) else '' end as [姓名23]
,case when [FN24] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN24]) else '' end as [姓名24]
,case when [FN25] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN25]) else '' end as [姓名25]
,case when [FN26] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN26]) else '' end as [姓名26]
,case when [FN27] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN27]) else '' end as [姓名27]
,case when [FN28] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN28]) else '' end as [姓名28]
,case when [FN29] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN29]) else '' end as [姓名29]
,case when [FN30] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN30]) else '' end as [姓名30]
,case when [FN31] in (select 人员编号 from 人事档案管理_人员名单) then (select 姓名 from 人事档案管理_人员名单 where 人员编号 = [FN31]) else '' end as [姓名31]
FROM
[基础数据_设备工位点检表] inner join [工位日点检任务记录]
on [基础数据_设备工位点检表].工位号 = [工位日点检任务记录].工位号
inner join [基础数据_点检内容]
on [工位日点检任务记录].点检任务编号 = [基础数据_点检内容].点检任务编号
where [基础数据_设备工位点检表].工位号 = '${num1}' and 年 = '${num2}' and 月 = '${num3}' order by [工位日点检任务记录].点检任务编号`
}
})
}

BIN
src/assets/img/HELI.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
src/assets/img/HELILOGO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -11,7 +11,7 @@
:value="item.value"
size="mini"/>
</el-select>
<div style="margin-top: 10px;margin-left: 10px">
<div style="margin-top: 10px;margin-left: 10px;">
<el-transfer
v-model="value"
:data="data"
@@ -103,21 +103,74 @@ export default {
}
})
},
distributionStation(value, direction, keyArr) {
// let followsArr = []
async distributionStation(value, direction, keyArr) {
// value为左/右的所有数值direction为方向left or rightkeyArr为选中的key
// eslint-disable-next-line no-unused-vars
let valueName
switch (direction) {
// 右到左 绑定
case 'left':
console.log(value, keyArr)
// 调用后端api绑定接口
for (let i = 0; i < keyArr.length; i++) {
valueName = keyArr[i]
await this.deleteAdd(valueName)
}
this.$message({
message: '分配成功',
type: 'success'
})
break
// 从左到右 解绑
case 'right':
console.log(value, keyArr)
// 调用后端api解绑接口
for (let i = 0; i < keyArr.length; i++) {
valueName = keyArr[i]
await this.opnameAdd(valueName)
}
this.$message({
message: '分配成功',
type: 'success'
})
break
}
},
async opnameAdd(val) {
var param = []
param[0] = ['UserId', this.peopleValue]
param[1] = ['OpName', val]
console.log(param)
var Data = this.CreateData('12', 'MES_Web_User_Add', param)
return new Promise((resolve, reject) => {
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
console.log('1')
resolve(1)
} else {
console.log('0')
reject(2)
}
})
})
},
async deleteAdd(val) {
var param = []
param[0] = ['UserId', this.peopleValue]
param[1] = ['OpName', val]
console.log(param)
var Data = this.CreateData('12', 'MES_Web_User_Delete', param)
return new Promise((resolve, reject) => {
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
console.log('1')
resolve(1)
} else {
console.log('0')
reject(2)
}
})
})
}
}
}

View File

@@ -485,7 +485,7 @@
size="55%">
<el-form ref="formData" :model="formData" :rules="rules" label-position="right" label-width="160px">
<el-form-item label="工位代码" prop="stationCode" style="display: inline-block">
<el-input v-model="formData.stationCode" clearable size="small" placeholder="工位代码"/>
<el-input v-model="formData.stationCode" clearable size="small" placeholder="工位代码" @blur="selectCode(formData.stationCode)"/>
</el-form-item>
<el-form-item label="工位号" prop="stationNumber" style="display: inline-block">
<el-input v-model="formData.stationNumber" clearable size="small" placeholder="工位号"/>
@@ -793,8 +793,7 @@ export default {
dataTypeValue: ''
},
rules: { // 表单验证规则
dataTypeValue: [{ required: true, message: '请选择', trigger: 'change' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
dataTypeValue: [{ required: true, message: '请选择', trigger: 'change' }]
},
formData: {
ID: '', // ID
@@ -877,6 +876,13 @@ export default {
this.searchTable()
},
methods: {
selectCode(val) {
for (let i = 0; i < this.tableData.length; i++) {
if (val === this.tableData[i].工位代码) {
this.$message.error('工位代码重复,请重新输入!')
}
}
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {

View File

@@ -2,6 +2,15 @@
<div class="app-container">
<el-card class="topCard">
<el-row>
<el-date-picker
v-model="monthValue"
:clearable="false"
class="elDataPicker"
type="month"
size="small"
style="width:150px;"
@change="changeMonth"
/>
<el-button type="distribution" size="small" icon="el-icon-circle-plus" style="margin-top: 10px">保存设置</el-button>
</el-row>
<el-row>
@@ -77,6 +86,7 @@ export default {
return {
tableData: [],
dateValue: '',
monthValue: new Date(),
checked: '',
value: new Date(),
multipleSelection: '',
@@ -85,39 +95,7 @@ export default {
}
},
created() {
for (let i = 1; i < 32; i++) {
let h = i
h = h < 10 ? ('0' + h) : h
this.dataC['2022-07-' + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
}
for (let i = 1; i < 32; i++) {
let h = i
h = h < 10 ? ('0' + h) : h
this.dataC['2022-08-' + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
}
for (let i = 1; i < 32; i++) {
let h = i
h = h < 10 ? ('0' + h) : h
this.dataC['2022-09-' + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
}
this.initializationDate()
this.getStationNumber()
},
mounted() {
@@ -134,6 +112,55 @@ export default {
window.dataC = this.dataC
},
methods: {
initializationDate() {
const date = this.monthValue
const month = date.getMonth() < 10 ? ('0' + date.getMonth()) : date.getMonth()
const month1 = date.getMonth() + 1 < 10 ? ('0') + (date.getMonth() + 1) : date.getMonth() + 1
const month2 = date.getMonth() + 2 < 10 ? ('0') + (date.getMonth() + 2) : date.getMonth() + 2
const time1 = date.getFullYear() + '-' + month1 + '-'
let time2, time
console.log(month, 'month')
if (month === '00') {
time = (date.getFullYear() - 1) + '-' + '12' + '-'
} else {
time = date.getFullYear() + '-' + month + '-'
}
if (month2 === 13) {
time2 = (date.getFullYear() + 1) + '-' + '01' + '-'
} else {
time2 = date.getFullYear() + '-' + month2 + '-'
}
console.log(time, time1, time2)
for (let i = 1; i < 32; i++) {
let h = i
h = h < 10 ? ('0' + h) : h
this.dataC[time + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
this.dataC[time1 + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
this.dataC[time2 + h] = {
banCheck: false, banTime: '11:00:00',
dayCheck: false, dayTime: '11:00:00',
weekCheck: false, weekTime: '11:00:00',
monthCheck: false, monthTime: '11:00:00',
yearCheck: false, yearTime: '11:00:00'
}
}
},
changeMonth() {
this.value = new Date(this.monthValue)
this.initializationDate()
},
selectBox(a) {
// a[0].isSelected = !a[0].isSelected
console.log('[data.day]', a)
@@ -215,30 +242,12 @@ export default {
/deep/.el-calendar-table:not(.is-range) td.next, .el-calendar-table:not(.is-range) td.prev{
pointer-events: none;
}
/*/deep/.el-calendar-day{*/
/* pointer-events: none;*/
/*}*/
/*.el-calendar-table:not(.is-range) td.prev,*/
/*.el-calendar-table:not(.is-range) td.next{*/
/* pointer-events: none;*/
/*}*/
/*.prev>.el-calendar-day>p{*/
/* display: none;*/
/*}*/
/*.next>.el-calendar-day>p{*/
/* display: none;*/
/*}*/
/*.el-calendar-table:not(.is-range) td.next, .el-calendar-table:not(.is-range) td.prev{*/
/* pointer-events: none;*/
/*}*/
/*/deep/.el-table{*/
/* border: 1px solid black!important;*/
/*}*/
/*/deep/.el-table th, .el-table tr{*/
/* border-color: black!important;*/
/*}*/
/*/deep/.el-table--enable-row-transition .el-table__body td{*/
/* border-color: black!important;*/
/*}*/
.elDataPicker>>>.el-input__inner{
height: 32px!important;
padding-left: 30px!important;
padding-right: 0!important;
}
/deep/.el-button-group{
display: none!important;
}
</style>

View File

@@ -0,0 +1,772 @@
<template>
<div class="app-container">
<el-card>
<div>
<span style="line-height: 25px">设备对应点检类型维护</span>
<div style="float: right;margin: 5px">
<el-select v-model="OPnameValue" filterable size="small" placeholder="工位号" style="width: 110px">
<el-option
v-for="item in OPname"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>选择月份</span>
<el-date-picker v-model="monthssss" size="small" type="month" value-format="yyyy-MM" format="yyyy-MM" style="width: 120px" placeholder="选择月"/>
<el-button v-positive="'loading'" :disabled="false" size="small" type="warning" style="margin-right: 50px" plain @click="exportOut()">导出日点检表</el-button>
</div>
</div>
<el-table v-loading="loading1" :data="tableData1" stripe height="200" border>
<el-table-column align="center" label="序号" type="index" width="50"/>
<el-table-column align="center" label="工位号" width="110">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column align="center" label="设备名称" min-width="150">
<template slot-scope="scope">
{{ scope.row.设备名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="设备编号" show-overflow-tooltip min-width="200">
<template slot-scope="scope">
{{ scope.row.设备编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="点检表类型" min-width="150">
<template slot-scope="scope">
<el-select v-model="tableData1[scope.$index].点检表类型流水号" filterable size="small" placeholder="点检表类型" style="margin:3px 10px;width: 150px" @change="editType(scope.row)">
<el-option
v-for="item in 点检表类型"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-col :span="6">
<span>点检类型维护</span>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" style="margin: 10px 0 3px 10px" @click="handleAdd1('form1')" >新增</el-button>
<el-table v-loading="loading2" :data="tableData2" height="300" highlight-current-row border @row-click="getTableData3">
<el-table-column align="center" label="序号" type="index" width="50"/>
<el-table-column align="center" label="点检类型名称" min-width="150">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.点检表类型名称" style="width:120px;margin-right:3px" clearable size="mini" width="120"/>
</template>
<span v-else>{{ scope.row.点检表类型名称 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="120">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit1(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit1(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="!scope.row.edit" type="text" size="mini" plain icon="el-icon-delete" @click="openDelete1(scope.row)"/>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="18">
<span>点检内容维护</span>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" style="margin: 10px 0 3px 10px" @click="handleAdd2('form2')" >新增</el-button>
<el-table v-loading="loading3" :data="tableData3" height="300" highlight-current-row border>
<el-table-column align="center" label="序号" type="index" width="50"/>
<el-table-column align="center" label="保养周期" min-width="110">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-select v-model="tableData3[scope.$index].保养周期" filterable size="small" placeholder="点检表类型" style="margin:3px 10px;width: 150px" @change="editType(scope.row)">
<el-option
v-for="item in 保养周期"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else slot-scope="scope">
<span v-if="scope.row.保养周期 === 1"></span>
<span v-if="scope.row.保养周期 === 7"></span>
<span v-if="scope.row.保养周期 === 30"></span>
<span v-if="scope.row.保养周期 === 90"></span>
<span v-if="scope.row.保养周期 === 365"></span>
</template>
</template>
</el-table-column>
<el-table-column align="center" label="保养项目" min-width="250">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.保养项目" style="width: 90%;margin-right:3px" clearable size="mini" width="120"/>
</template>
<span v-else>{{ scope.row.保养项目 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="120">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit2(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit2(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="!scope.row.edit" type="text" size="mini" plain icon="el-icon-delete" @click="openDelete2(scope.row)"/>
</template>
</el-table-column>
</el-table>
</el-col>
</el-card>
<el-card v-show="false" style="width: 1565px">
<div id="dianjianbiao">
<div style="width: 1541px;font-size: 28px;font-weight: bold;text-align: center;">设备保养点检记录表</div>
<div>
<span style="font-size: 20px;margin-left: 50px">设备名称</span>
<span style="font-size: 20px">{{ 设备名称 }}</span>
<span style="font-size: 20px;margin-left: 50px">设备编号</span>
<span style="font-size: 20px">{{ 设备编号 }}</span>
</div>
<el-table :data="tableData" :resizable="false" style="margin: 5px 0 0 0;width: 1541px" border>
<el-table-column :resizable="false" align="center" label="项次" type="index" width="50"/>
<el-table-column :resizable="false" align="center" label="日保养项目" width="250">
<template slot-scope="scope">
{{ scope.row.保养项目 }}
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="1" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F1===1">V</span>
<span v-if="scope.row.F1===2">R</span>
<span v-if="scope.row.F1===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="2" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F2===1">V</span>
<span v-if="scope.row.F2===2">R</span>
<span v-if="scope.row.F2===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="3" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F3===1">V</span>
<span v-if="scope.row.F3===2">R</span>
<span v-if="scope.row.F3===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="4" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F4===1">V</span>
<span v-if="scope.row.F4===2">R</span>
<span v-if="scope.row.F4===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="5" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F5===1">V</span>
<span v-if="scope.row.F5===2">R</span>
<span v-if="scope.row.F5===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="6" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F6===1">V</span>
<span v-if="scope.row.F6===2">R</span>
<span v-if="scope.row.F6===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="7" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F7===1">V</span>
<span v-if="scope.row.F7===2">R</span>
<span v-if="scope.row.F7===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="8" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F8===1">V</span>
<span v-if="scope.row.F8===2">R</span>
<span v-if="scope.row.F8===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="9" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F9===1">V</span>
<span v-if="scope.row.F9===2">R</span>
<span v-if="scope.row.F9===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="10" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F10===1">V</span>
<span v-if="scope.row.F10===2">R</span>
<span v-if="scope.row.F10===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="11" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F11===1">V</span>
<span v-if="scope.row.F11===2">R</span>
<span v-if="scope.row.F11===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="12" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F12===1">V</span>
<span v-if="scope.row.F12===2">R</span>
<span v-if="scope.row.F12===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="13" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F13===1">V</span>
<span v-if="scope.row.F13===2">R</span>
<span v-if="scope.row.F13===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="14" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F14===1">V</span>
<span v-if="scope.row.F14===2">R</span>
<span v-if="scope.row.F14===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="15" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F15===1">V</span>
<span v-if="scope.row.F15===2">R</span>
<span v-if="scope.row.F15===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="16" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F16===1">V</span>
<span v-if="scope.row.F16===2">R</span>
<span v-if="scope.row.F16===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="17" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F17===1">V</span>
<span v-if="scope.row.F17===2">R</span>
<span v-if="scope.row.F17===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="18" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F18===1">V</span>
<span v-if="scope.row.F18===2">R</span>
<span v-if="scope.row.F18===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="19" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F19===1">V</span>
<span v-if="scope.row.F19===2">R</span>
<span v-if="scope.row.F19===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="20" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F20===1">V</span>
<span v-if="scope.row.F20===2">R</span>
<span v-if="scope.row.F20===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="21" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F21===1">V</span>
<span v-if="scope.row.F21===2">R</span>
<span v-if="scope.row.F21===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="21" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F21===1">V</span>
<span v-if="scope.row.F21===2">R</span>
<span v-if="scope.row.F21===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="23" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F23===1">V</span>
<span v-if="scope.row.F23===2">R</span>
<span v-if="scope.row.F23===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="24" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F24===1">V</span>
<span v-if="scope.row.F24===2">R</span>
<span v-if="scope.row.F24===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="25" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F25===1">V</span>
<span v-if="scope.row.F25===2">R</span>
<span v-if="scope.row.F25===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="26" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F26===1">V</span>
<span v-if="scope.row.F26===2">R</span>
<span v-if="scope.row.F26===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="27" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F27===1">V</span>
<span v-if="scope.row.F27===2">R</span>
<span v-if="scope.row.F27===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="28" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F28===1">V</span>
<span v-if="scope.row.F28===2">R</span>
<span v-if="scope.row.F28===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="29" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F29===1">V</span>
<span v-if="scope.row.F29===2">R</span>
<span v-if="scope.row.F29===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="30" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F30===1">V</span>
<span v-if="scope.row.F30===2">R</span>
<span v-if="scope.row.F30===3">X</span>
</template>
</el-table-column>
<el-table-column :resizable="false" align="center" label="31" width="40">
<template slot-scope="scope">
<span v-if="scope.row.F31===1">V</span>
<span v-if="scope.row.F31===2">R</span>
<span v-if="scope.row.F31===3">X</span>
</template>
</el-table-column>
</el-table>
<div style="width: 300px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 80px;"> 操作工</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名1 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名2 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名3 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名4 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名5 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名6 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名7 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名8 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名9 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名10 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名11 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名12 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名13 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名14 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名15 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名16 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名17 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名18 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名19 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名20 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名21 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名22 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名23 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名24 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名25 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名26 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名27 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名28 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名29 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名30 : '' }}</div>
<div style="width: 40px;height: 80px;border: 1px solid rgb(235,238,245);float: left;text-align: center;line-height: 40px;-webkit-writing-mode: vertical-rl;">{{ tableData[0] ? tableData[0].姓名31 : '' }}</div>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible1" title="新增" center width="500px">
<el-form ref="form1" :model="form1" :rules="rules" label-position="right" label-width="160px">
<el-form-item label="点检类型名称" prop="点检类型名称">
<el-input v-model="form1.点检类型名称" placeholder="点检类型名称" clearable size="small" style="width:180px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff1('form1')">取消</el-button>
<el-button v-positive="'loading'" :disabled="false" type="primary" @click="submit1('form1')" >确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="新增" center width="500px">
<el-form ref="form2" :model="form2" :rules="rules" label-position="right" label-width="160px">
<el-form-item label="保养项目" prop="保养项目">
<el-input v-model="form2.保养项目" placeholder="保养项目" clearable size="small" style="width:180px;"/>
</el-form-item>
<el-form-item label="保养周期" prop="保养周期">
<el-select v-model="form2.保养周期" filterable size="small" placeholder="保养周期" style="width: 180px">
<el-option
v-for="item in 保养周期"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff2('form2')">取消</el-button>
<el-button v-positive="'loading'" :disabled="false" type="primary" @click="submit2('form2')" >确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getTableData1, getTableData2, getTableData3, editType, confirmEdit1, confirmEdit2, selectCount, openDelete1, openDelete2, submit1, submit2, exportOut } from '@/api/ManufacturingCenter/maintainInformation'
import $ from 'jquery'
export default {
data() {
return {
点检表类型: [],
tableData1: [],
loading1: false,
tableData2: [],
loading2: false,
点检表类型流水号: '',
保养周期: [{
value: 1,
label: '日'
}, {
value: 7,
label: '周'
}, {
value: 30,
label: '月'
}, {
value: 90,
label: '季'
}, {
value: 365,
label: '年'
}],
tableData3: [],
loading3: false,
form1: {
点检类型名称: ''
},
dialogFormVisible1: false,
form2: {
保养项目: '',
保养周期: ''
},
dialogFormVisible2: false,
rules: { // 表单验证规则
点检类型名称: [{ required: true, message: '请输入点检类型名称', trigger: 'blur' }],
保养项目: [{ required: true, message: '请输入保养项目', trigger: 'blur' }],
保养周期: [{ required: true, message: '请选择保养周期', trigger: 'change' }]
},
OPnameValue: '',
OPname: [],
monthssss: '',
tableData: [],
设备名称: '',
设备编号: ''
}
},
created() {
this.getTableData1()
this.getTableData2()
},
methods: {
getTableData1() {
this.OPname = []
this.tableData1 = []
this.loading1 = true
getTableData1().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.OPname.push({
label: response.data[i].工位号,
value: response.data[i].工位号
})
}
this.tableData1 = response.data
this.loading1 = false
})
},
// 编辑 表1
editType(row) {
editType(row.点检表类型流水号, row.ID)
},
getTableData2() {
this.点检表类型 = []
this.tableData2 = []
this.loading2 = true
getTableData2().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.点检表类型.push({
label: response.data[i].点检表类型名称,
value: response.data[i].点检表类型流水号
})
}
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
点检表类型流水号: response.data[i].点检表类型流水号,
点检表类型名称: response.data[i].点检表类型名称,
点检表类型流水号_原: response.data[i].点检表类型流水号,
点检表类型名称_原: response.data[i].点检表类型名称,
edit: false
})
}
}
this.loading2 = false
})
},
// 取消编辑
cancelEdit1(index, row) {
row.edit = false
row.点检表类型名称 = this.tableData2[index].点检表类型名称_原
this.$message('取消修改')
},
// 编辑 表2
confirmEdit1(row) {
confirmEdit1(row.点检表类型名称, row.点检表类型流水号).then(response => {
row.edit = false
})
},
// 删除 表2
openDelete1(row) {
this.$confirm('此操作将永久删除该行信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
selectCount(row.点检表类型流水号).then(response => {
if (response.data.length === 0) {
openDelete1(row.点检表类型流水号).then(() => {
this.tableData3 = []
this.getTableData2()
})
} else {
var message
message = '工位:'
for (let i = 0; i < response.data.length; i++) {
if (i === response.data.length - 1) {
message = message + response.data[i].工位号
} else {
message = message + response.data[i].工位号 + '、'
}
}
message = message + '占用,请先将以上工位改为其他点检类型'
this.$message.error(message)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 新增 表2
handleAdd1(formName) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.form1.点检类型名称 = ''
this.dialogFormVisible1 = true
},
callOff1() {
this.dialogFormVisible1 = false
},
submit1(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
submit1(this.form1.点检类型名称).then(response => {
this.getTableData2()
this.dialogFormVisible1 = false
})
} else {
return false
}
})
},
getTableData3(row) {
this.点检表类型流水号 = row.点检表类型流水号
this.tableData3 = []
this.loading3 = true
getTableData3(row.点检表类型流水号).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData3.push({
ID: response.data[i].ID,
保养周期: response.data[i].保养周期,
保养项目: response.data[i].保养项目,
保养周期_原: response.data[i].保养周期,
保养项目_原: response.data[i].保养项目,
edit: false
})
}
}
this.loading3 = false
})
},
// 取消编辑
cancelEdit2(index, row) {
row.edit = false
row.保养周期 = this.tableData3[index].保养周期_原
row.保养项目 = this.tableData3[index].保养项目_原
this.$message('取消修改')
},
// 编辑 表3
confirmEdit2(row) {
confirmEdit2(row.保养周期, row.保养项目, row.ID).then(response => {
row.edit = false
})
},
// 删除 表3
openDelete2(row) {
this.$confirm('此操作将永久删除该行信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
openDelete2(row.ID).then(() => {
this.tableData3 = []
this.loading3 = true
getTableData3(this.点检表类型流水号).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData3.push({
ID: response.data[i].ID,
保养周期: response.data[i].保养周期,
保养项目: response.data[i].保养项目,
保养周期_原: response.data[i].保养周期,
保养项目_原: response.data[i].保养项目,
edit: false
})
}
}
this.loading3 = false
})
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 新增 表3
handleAdd2(formName) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.form2.保养项目 = ''
this.form2.保养周期 = ''
if (this.点检表类型流水号) {
this.dialogFormVisible2 = true
} else {
this.$message.error('请先选择一个点检类型')
}
},
callOff2() {
this.dialogFormVisible2 = false
},
submit2(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.点检表类型流水号) {
submit2(this.点检表类型流水号, this.form2.保养项目, this.form2.保养周期).then(response => {
this.tableData3 = []
this.loading3 = true
getTableData3(this.点检表类型流水号).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData3.push({
ID: response.data[i].ID,
保养周期: response.data[i].保养周期,
保养项目: response.data[i].保养项目,
保养周期_原: response.data[i].保养周期,
保养项目_原: response.data[i].保养项目,
edit: false
})
}
}
this.loading3 = false
})
})
}
this.dialogFormVisible2 = false
} else {
return false
}
})
},
exportOut() {
this.tableData = []
if (this.OPnameValue) {
if (this.monthssss) {
var year = this.monthssss.split('-')[0]
var month = this.monthssss.split('-')[1]
exportOut(this.OPnameValue, year, month).then(response => {
if (response.data.length !== 0) {
this.设备名称 = response.data[0].设备名称
this.设备编号 = response.data[0].设备编号
this.tableData = response.data
}
}).then(() => {
if (this.tableData.length !== 0) {
this.Out()
} else {
this.$message.error('暂无该月数据')
}
})
} else {
this.$message.error('请选择月份')
}
} else {
this.$message.error('请选择工位')
}
},
Out() {
const htmlNode = $('#dianjianbiao').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
}
}
}
</script>
<style lang="scss">
.NewlyAdded{
background:rgb(253,246,236);
border-color: #ff9759;
color: #ff9759;
&:hover{
background: #ff9759;
border-color: #ff9759;
color: white;
}
&:focus{
background: #ff9759;
border-color: #ff9759;
color: white;
}
}
#dianjianbiao {
/*.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{*/
/*border-color: black !important;*/
/*}*/
/*.el-table--border::after, .el-table--group::after, .el-table::before{*/
/*background-color: black !important;*/
/*}*/
/*th {*/
/*background: white !important;*/
/*color: black !important;*/
/*}*/
}
</style>

View File

@@ -24,6 +24,7 @@
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-order" @click="searchTable()">查询</el-button>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="addTo">新增</el-button>
<el-button type="success" size="small" plain icon="el-icon-document-copy" @click="copyOrder('form4')">复制工步</el-button>
</div>
<el-table
ref="multipleTable"
@@ -67,7 +68,7 @@
</el-select>
</el-form-item>
<el-form-item label="产品型号:" prop="moduleDescription" style="display: inline-block">
<el-select v-model="engineTypeValue1" placeholder="请选择产品型号" clearable size="small" style="width: 200px">
<el-select v-model="form.moduleDescription" placeholder="请选择产品型号" clearable size="small" style="width: 200px">
<el-option
v-for="item in engineType"
:key="item.value"
@@ -116,6 +117,34 @@
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitUpdate('form1')">确定</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.stationNumberValue" placeholder="请选择工位号" size="small">
<el-option
v-for="item in stationNumber"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
</el-form-item>
<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 engineType"
: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>
@@ -126,11 +155,11 @@ export default {
return {
tableData: [], // 总数据数组
stationNumber: [],
stationNumberValue: 'OP1005',
stationName: '扫描上线工位',
stationNumberValue: '',
stationName: '',
moduleDescription: [],
moduleDescriptionValue: '',
engineTypeValue: 'SGM-5P',
engineTypeValue: '',
engineTypeValue1: '',
engineTypeName: '',
engineType: [],
@@ -160,6 +189,7 @@ export default {
labelNumber: '',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible4: false,
title: '',
form: {
stationNumber: '',
@@ -180,6 +210,14 @@ export default {
rules1: {
number: [{ required: true, message: '请输入序号', trigger: 'blur' }],
text: [{ required: true, message: '请输入操作内容', trigger: 'blur' }]
},
form4: {
engineTypeValue: '',
stationNumberValue: ''
},
rules4: { // 订单下发验证
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'blur' }]
}
}
},
@@ -207,23 +245,30 @@ export default {
for (let i = 0; i < this.engineType.length; i++) {
if (this.engineType[i].value === this.engineTypeValue1) {
this.engineTypeName = this.engineType[i].labelName
this.form.moduleDescription = this.engineType[i].label
console.log(this.engineTypeName, 'this.engineTypeName')
}
}
}
},
created() {
this.searchTable()
this.getStationNumber()
this.getEndStation()
},
mounted() {
setTimeout(() => {
this.searchTable()
}, 300)
},
methods: {
getStationNumber() {
this.stationNumber = []
var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length) {
this.stationNumberValue = response.data[0].工位号
this.stationName = response.data[0].工序名称
}
for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({
label: response.data[i].工位号,
@@ -239,6 +284,7 @@ export default {
var param = []
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length) this.engineTypeValue = response.data[0].发动机型号
for (let i = 0; i < response.data.length; i++) {
this.engineType.push({
label: response.data[i].发动机型号,
@@ -275,6 +321,59 @@ export default {
}
})
},
copyOrder(formName) {
if (this.tableData.length) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.dialogFormVisible4 = true
} else {
this.$message({
message: '暂无可复制的数据!',
type: 'error'
})
}
},
async submitAdd4() {
let number, text
for (let i = 0; i < this.tableData.length; i++) {
number = this.tableData[i].工步号
text = this.tableData[i].操作内容
await this.submitAdd5(number, text)
}
this.$message({
message: '增加成功',
type: 'success'
})
this.dialogFormVisible4 = false
this.engineTypeValue = this.form4.engineTypeValue
this.stationNumberValue = this.form4.stationNumberValue
this.searchTable()
},
async submitAdd5(number, text) {
var param = []
param[0] = ['工位号', this.form4.stationNumberValue]
param[1] = ['产品型号代码', this.form4.engineTypeValue]
param[2] = ['工步号', number]
param[3] = ['操作内容', text]
param[4] = ['发动机型号', this.form4.engineTypeValue]
console.log(param)
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
return new Promise((resolve, reject) => {
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
console.log('1')
resolve(1)
} else {
console.log('0')
reject(2)
}
})
})
},
callOff4() {
this.dialogFormVisible4 = false
},
addTo() {
this.title = '添加'
this.dialogFormVisible = true
@@ -287,7 +386,7 @@ export default {
param[1] = ['产品型号代码', this.form.moduleDescription]
param[2] = ['工步号', this.form.number]
param[3] = ['操作内容', this.form.text]
param[4] = ['发动机型号', this.engineTypeName]
param[4] = ['发动机型号', this.form.moduleDescription]
console.log(param)
var Data = this.CreateData('12', '电子看板_工序内容_增加', param)
this.ExecDatabase(Data).then(response => {

View File

@@ -77,6 +77,7 @@
</el-form>
<el-button type="info" plain size="small" style="margin-left: 80px" @click="viewAllow()">预览全部</el-button>
<el-button type="info" plain size="small" @click="clearAll()">全部清除</el-button>
<el-button type="success" size="small" plain icon="el-icon-document-copy" style="margin: 48px 0 0 0px" @click="copyOrder('form4')">复制工步</el-button>
</el-col>
<el-col style="width: 1000px">
<div style="border: 1px solid black;width: 772px;height: 642px;margin-top: 10px">
@@ -189,6 +190,34 @@
<!-- <numKeyboards id="keyboards" ref="keyboards" :keyboardtext="numKeyboarInfo.keyboardtext" @updatekey="numKeyboardsGetValueFn" @enterClick="numKeyboardsEnterClickFn" />-->
<!-- </div>-->
</el-card>
<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.stationNumberValue" placeholder="请选择工位号" size="small">
<el-option
v-for="item in stationNumber"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
</el-form-item>
<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 engineType"
: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>
@@ -237,6 +266,15 @@ export default {
explain: ''
},
rules: {
},
dialogFormVisible4: false,
form4: {
engineTypeValue: '',
stationNumberValue: ''
},
rules4: { // 订单下发验证
engineTypeValue: [{ required: true, message: '请选择机型', trigger: 'blur' }],
stationNumberValue: [{ required: true, message: '请选择工位号', trigger: 'blur' }]
}
}
},
@@ -337,6 +375,77 @@ export default {
}
})
},
copyOrder(formName) {
if (this.tableData.length) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.dialogFormVisible4 = true
} else {
this.$message({
message: '暂无可复制的数据!',
type: 'error'
})
}
},
async submitAdd4() {
let serialNumber, positionX, positionY, measureWidth, measureHeight, groupNumber, orderNumber, sleeveNumber, torque, measureType, explain
for (let i = 0; i < this.tableData.length; i++) {
serialNumber = this.tableData[i].序号
positionX = this.tableData[i].测量位置X
positionY = this.tableData[i].测量位置Y
measureWidth = this.tableData[i].控件宽度
measureHeight = this.tableData[i].控件高度
groupNumber = this.tableData[i].组号
orderNumber = this.tableData[i].工作顺序
sleeveNumber = this.tableData[i].套筒号
torque = this.tableData[i].扭矩
measureType = this.tableData[i].控件类型
explain = this.tableData[i].说明
await this.submitAdd5(serialNumber, positionX, positionY, measureWidth, measureHeight, groupNumber, orderNumber, sleeveNumber, torque, measureType, explain)
}
this.$message({
message: '增加成功',
type: 'success'
})
this.dialogFormVisible4 = false
this.engineTypeValue = this.form4.engineTypeValue
this.stationNumberValue = this.form4.stationNumberValue
this.searchTable()
this.searchTable1()
},
async submitAdd5(serialNumber, positionX, positionY, measureWidth, measureHeight, groupNumber, orderNumber, sleeveNumber, torque, measureType, explain) {
var param = []
param[0] = ['工位号', this.form4.stationNumberValue]
param[1] = ['发动机型号', this.form4.engineTypeValue]
param[2] = ['序号', serialNumber]
param[3] = ['测量位置X', positionX]
param[4] = ['测量位置Y', positionY]
param[5] = ['控件宽度', measureWidth]
param[6] = ['控件高度', measureHeight]
param[7] = ['组号', groupNumber]
param[8] = ['工作顺序', orderNumber]
param[9] = ['套筒号', sleeveNumber]
param[10] = ['扭矩', torque]
param[11] = ['控件类型', measureType]
param[12] = ['说明', explain]
console.log(param)
var Data = this.CreateData('12', '电子看板_工位机型_质量数据测量位置_增加', param)
return new Promise((resolve, reject) => {
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
console.log('1')
resolve(1)
} else {
console.log('0')
reject(2)
}
})
})
},
callOff4() {
this.dialogFormVisible4 = false
},
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {

View File

@@ -32,11 +32,11 @@
{{ scope.row.发动机机型标志 }}
</template>
</el-table-column>
<el-table-column align="center" label="配方号">
<template slot-scope="scope">
{{ scope.row.配方号 }}
</template>
</el-table-column>
<!-- <el-table-column align="center" label="配方号">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.配方号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="总成物料号">
<template slot-scope="scope">
{{ scope.row.总成物料号 }}
@@ -94,12 +94,12 @@
size="small"
placeholder="发动机型号"/>
</el-form-item>
<el-form-item label="配方号" prop="formula" style="display: inline-block">
<el-form-item label="发动机机型标志" prop="equipmentSign" style="display: inline-block">
<el-input
v-model="form.formula"
v-model="form.equipmentSign"
clearable
size="small"
placeholder="配方号"/>
placeholder="发动机机型标志"/>
</el-form-item>
<el-form-item label="总成物料号" prop="itemNo" style="display: inline-block">
<el-input
@@ -119,7 +119,7 @@
</el-select>
</el-form-item>
<el-form-item label="吨位标志" prop="tonnageSign" style="display: inline-block">
<el-select v-model="form.tonnageSign" placeholder="请选择" size="small" style="display: inline-block" @change="selectValue(form.tonnageSign)">
<el-select v-model="form.tonnageSign" placeholder="请选择" size="small" style="display: inline-block">
<el-option
v-for="item in tonnageSign"
:key="item.value"
@@ -128,14 +128,6 @@
size="mini"/>
</el-select>
</el-form-item>
<el-form-item label="发动机机型标志" prop="equipmentSign" style="display: inline-block">
<el-input
v-model="form.equipmentSign"
disabled
clearable
size="small"
placeholder="发动机机型标志"/>
</el-form-item>
<el-form-item label="是否禁用" prop="enDisable" style="display: inline-block">
<el-select v-model="form.enDisable" placeholder="请选择" size="small" style="display: inline-block">
<el-option
@@ -265,9 +257,6 @@ export default {
this.loading = false
})
},
selectValue(val) {
this.form.equipmentSign = val
},
// 创建订单
creatOrder(formName) {
if (this.$refs[formName] !== undefined) {
@@ -294,7 +283,6 @@ export default {
param[3] = ['箱体标志', this.form.boxSign]
param[4] = ['吨位标志', this.form.tonnageSign]
param[5] = ['是否禁用', this.form.enDisable]
param[6] = ['配方号', this.form.formula]
var Data = this.CreateData('12', 'MES_基本变量_机型代码_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
@@ -375,7 +363,6 @@ export default {
param[4] = ['吨位标志', this.form.tonnageSign]
param[5] = ['是否禁用', this.form.enDisable]
param[6] = ['序号', this.form.ID]
param[7] = ['配方号', this.form.formula]
var Data = this.CreateData('12', 'MES_基本变量_机型代码_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {

View File

@@ -0,0 +1,352 @@
<!--物料ANDON统计-->
<template>
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">时间</span>
<el-date-picker
v-model="dateTime"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span style="margin-left: 10px">工位号</span>
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
<el-option
v-for="item in stationNumber"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=15;pageCurrent=1;searchOrder();searchOrder1()">查询</el-button>
<!-- <el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>-->
</div>
<div style="border: 1px solid #EBEEF5;width: 100%;height: 400px;">
<div id="myChart" style="width: 100%;height: 380px;float: right;"/>
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="tableData"
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
:cell-class-name="tableRowClassName"
element-loading-text="数据加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.2)"
class="main"
tooltip-effect="dark"
height="450px"
style="width: 100%;"
border
size="mini">
<el-table-column align="center" width="60px" type="index" label="序号"/>
<el-table-column align="center" label="工厂">
<template slot-scope="scope">
{{ scope.row.Factory }}
</template>
</el-table-column>
<el-table-column align="center" label="工作中心">
<template slot-scope="scope">
{{ scope.row.WorkCenter }}
</template>
</el-table-column>
<el-table-column align="center" label="工位号">
<template slot-scope="scope">
{{ scope.row.OpCode }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺描述">
<template slot-scope="scope">
{{ scope.row.OpName }}
</template>
</el-table-column>
<el-table-column align="center" label="装配总数">
<template slot-scope="scope">
{{ scope.row.SUMCount }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数">
<template slot-scope="scope">
{{ scope.row.RJCount }}
</template>
</el-table-column>
<el-table-column align="center" label="工位FTT">
<template slot-scope="scope">
{{ scope.row.OpFTT }}
</template>
</el-table-column>
<el-table-column align="center" label="产线FTT">
<template slot-scope="scope">
{{ scope.row.SumFTT }}
</template>
</el-table-column>
<el-table-column align="center" width="280px" label="操作时间">
<template slot-scope="scope">
{{ scope.row.Time }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[15, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<!--<script src="../../../utils/setMethods.js"></script>-->
<script>
export default {
data() {
return {
number: [],
tableData: [], // 总数据数组
tableData1: [], // 总数据数组
xData: [], // echars x轴
yData: [], // echars y轴
// engineTypeValue: '', // 产品型号
// engineType: [], // 产品型号数组
// orderNumber: [], // 订单号
// orderNumberValue: '', // 订单号
stationNumberValue: '', // 工位号
stationNumber: [], // 工位号
statePlan: [], // 计划状态数组
statePlanValue: '', // 计划状态
importTime: '', // 计划状态
releaseTime: '', // 计划状态
dateTime: '',
total: 0, // 总条数
pageList: 15, // 每页显示条数
pageSize: 15, // 每页显示条数
pageCurrent: 1, // 后台获取页
mid: [], // id
loading: false,
timer_1: null,
MIDGroup: []
}
},
created() {
var year, month, day, audiTime
this.date = new Date() // 修改数据date
year = new Date().getFullYear()
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
audiTime = year + '-' + month + '-' + day
console.log(audiTime, 'audiTime')
this.dateTime = [audiTime, audiTime]
this.getStationNumber()
},
mounted() {
},
methods: {
// 表格颜色变化
tableRowClassName({ row, rowIndex }) {
// console.log(row, rowIndex)
if (rowIndex % 2 === 0) {
return 'black'
} else {
return 'red'
}
},
// 工位号
getStationNumber() {
this.stationNumber = []
this.xData = []
var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length) this.stationNumberValue = response.data[0].工位号
for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({
label: response.data[i].工位号,
value: response.data[i].工位号
})
this.xData.push(response.data[i].工位号)
}
})
},
// 实时扭矩曲线
drawLine() {
// 基于准备好的dom初始化echarts实例
const myChart = this.$echarts.init(document.getElementById('myChart'))
myChart.clear()
myChart.setOption({
title: {
left: 'center',
text: 'FTT趋势图'
},
toolbox: {// echart保存为图片
show: true,
feature: {
mark: {
show: true
},
saveAsImage: {
show: true,
pixelRatio: 1,
title: '保存为图片',
type: 'png',
lang: ['点击保存']
}
}
},
xAxis: {
type: 'category',
data: this.xData,
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval: 0,
rotate: 30
}
},
yAxis: {
type: 'value'
},
series: [
{
name: 'NO',
data: this.yData,
type: 'line',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: { // 上方显示数值
normal: {
label: {
show: true, // 开启显示
position: 'top', // 在上方显示
textStyle: { // 数值样式
color: 'black',
fontSize: 16
}
}
}
}
}
]
})
},
// 查询订单
searchOrder() {
this.tableData = []
let stationNumberValue_check
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
var param = []
param[0] = ['StartTime', this.dateTime[0]]
param[1] = ['EndTime', this.dateTime[1]]
param[2] = ['OpName_ischeck', stationNumberValue_check]
param[3] = ['OpName', this.stationNumberValue]
// param[4] = ['订单号_ischeck', orderNumberValue_check]
// param[5] = ['订单号', this.orderNumberValue]
// param[6] = ['产品型号_ischeck', engineTypeValue_check]
// param[7] = ['产品型号', this.engineTypeValue]
param[4] = ['PageCurrent', this.pageCurrent]
param[5] = ['PageSize', this.pageSize]
param[6] = ['PageCount', '1111', 'int', '1']
param[7] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', 'Data_WorkStationFTT_Statistic_Form', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) {
this.tableData = response.data.result
}
this.total = parseInt(response.data.output[0].ItemCount)
this.loading = false
})
},
// 查询订单
searchOrder1() {
this.yData = []
this.xData = []
this.tableData1 = []
let stationNumberValue_check
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
// this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
var param = []
param[0] = ['StartTime', this.dateTime[0]]
param[1] = ['EndTime', this.dateTime[1]]
param[2] = ['OpName_ischeck', stationNumberValue_check]
param[3] = ['OpName', this.stationNumberValue]
var Data = this.CreateData('11', 'Data_WorkStationFTT_Statistic_Graph', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.xData.push((response.data[i].AddTime).slice(0, 10))
this.yData.push(response.data[i].FTTValue)
}
console.log(this.xData, 'this.xData')
}
}).then(() => {
this.drawLine()
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchOrder()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchOrder()
}
}
}
</script>
<style scoped>
.topCard{
margin: 5px;
}
.topDiv{
margin-bottom: 10px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
.text {
font-size: 14px;
}
.item {
padding: 18px 0;
}
.box-card {
position: absolute;
right: 6px;
top: 80px;
width: 300px;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@@ -0,0 +1,278 @@
<!--物料ANDON统计-->
<template>
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">时间</span>
<el-date-picker
v-model="dateTime"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=12;pageCurrent=1;searchOrder();searchOrder1()">查询</el-button>
<!-- <el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>-->
</div>
<div style="border: 1px solid #EBEEF5;width: 100%;height: 400px;">
<div id="myChart" style="width: 100%;height: 380px;float: right;"/>
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="tableData"
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
:cell-class-name="tableRowClassName"
element-loading-text="数据加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.2)"
class="main"
tooltip-effect="dark"
height="450px"
style="width: 100%;"
border
size="mini">
<el-table-column align="center" width="60px" type="index" label="序号"/>
<el-table-column align="center" label="日期">
<template slot-scope="scope">
{{ scope.row.StaticTime }}
</template>
</el-table-column>
<el-table-column align="center" label="时间">
<template slot-scope="scope">
{{ scope.row.TimeSlot }}
</template>
</el-table-column>
<el-table-column align="center" label="数量">
<template slot-scope="scope">
{{ scope.row.JPHValue }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[15, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<!--<script src="../../../utils/setMethods.js"></script>-->
<script>
export default {
data() {
return {
number: [],
tableData: [], // 总数据数组
tableData1: [], // 总数据数组
xData: [], // echars x轴
yData: [], // echars y轴
// engineTypeValue: '', // 产品型号
// engineType: [], // 产品型号数组
// orderNumber: [], // 订单号
// orderNumberValue: '', // 订单号
stationNumberValue: '', // 工位号
stationNumber: [], // 工位号
statePlan: [], // 计划状态数组
statePlanValue: '', // 计划状态
importTime: '', // 计划状态
releaseTime: '', // 计划状态
dateTime: '',
total: 0, // 总条数
pageList: 15, // 每页显示条数
pageSize: 15, // 每页显示条数
pageCurrent: 1, // 后台获取页
mid: [], // id
loading: false,
timer_1: null,
MIDGroup: []
}
},
created() {
var year, month, day, audiTime
this.date = new Date() // 修改数据date
year = new Date().getFullYear()
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
audiTime = year + '-' + month + '-' + day
console.log(audiTime, 'audiTime')
this.dateTime = [audiTime, audiTime]
},
mounted() {
},
methods: {
// 表格颜色变化
tableRowClassName({ row, rowIndex }) {
// console.log(row, rowIndex)
if (rowIndex % 2 === 0) {
return 'black'
} else {
return 'red'
}
},
// 实时扭矩曲线
drawLine() {
// 基于准备好的dom初始化echarts实例
const myChart = this.$echarts.init(document.getElementById('myChart'))
myChart.clear()
myChart.setOption({
title: {
left: 'center',
text: 'FTT趋势图'
},
toolbox: {// echart保存为图片
show: true,
feature: {
mark: {
show: true
},
saveAsImage: {
show: true,
pixelRatio: 1,
title: '保存为图片',
type: 'png',
lang: ['点击保存']
}
}
},
xAxis: {
type: 'category',
data: this.xData,
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval: 0,
rotate: 30
}
},
yAxis: {
type: 'value'
},
series: [
{
name: 'NO',
data: this.yData,
type: 'line',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: { // 上方显示数值
normal: {
label: {
show: true, // 开启显示
position: 'top', // 在上方显示
textStyle: { // 数值样式
color: 'black',
fontSize: 16
}
}
}
}
}
]
})
},
// 查询订单
searchOrder() {
this.tableData = []
var param = []
param[0] = ['Startdate', this.dateTime[0]]
param[1] = ['PageCurrent', this.pageCurrent]
param[2] = ['PageSize', this.pageSize]
param[3] = ['PageCount', '1111', 'int', '1']
param[4] = ['ItemCount', '1111', 'int', '1']
param[5] = ['Enddate', this.dateTime[1]]
var Data = this.CreateData('11', 'Data_WorkStationJPH_Statistic_Form', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) {
this.tableData = response.data.result
}
this.total = parseInt(response.data.output[0].ItemCount)
this.loading = false
})
},
// 查询订单
searchOrder1() {
this.yData = []
this.xData = []
this.tableData1 = []
var param = []
param[0] = ['StartDatetime', this.dateTime[0]]
var Data = this.CreateData('11', 'Data_WorkStationJPH_Statistic_Add', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.xData.push(response.data[i].TimeSlot)
this.yData.push(response.data[i].JPHValue)
}
console.log(this.xData, 'this.xData')
}
}).then(() => {
this.drawLine()
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchOrder()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchOrder()
}
}
}
</script>
<style scoped>
.topCard{
margin: 5px;
}
.topDiv{
margin-bottom: 10px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
.text {
font-size: 14px;
}
.item {
padding: 18px 0;
}
.box-card {
position: absolute;
right: 6px;
top: 80px;
width: 300px;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@@ -0,0 +1,360 @@
<!--物料ANDON统计-->
<template>
<div class="app-container">
<el-card class="topCard">
<div class="topDiv">
<span style="margin-left: 10px">时间</span>
<el-date-picker
v-model="dateTime"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span style="margin-left: 10px">工位号</span>
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
<el-option
v-for="item in stationNumber"
:key="item.value"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
<!-- <el-select v-model="engineTypeValue" placeholder="请选择产品型号" clearable size="small" style="width: 150px">-->
<!-- <el-option-->
<!-- v-for="item in engineType"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- size="mini"/>-->
<!-- </el-select>-->
<!-- <span style="margin-left: 10px">订单号</span>-->
<!-- <el-select v-model="orderNumberValue" placeholder="请选择订单" clearable size="small" style="width: 150px">-->
<!-- <el-option-->
<!-- v-for="item in orderNumber"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- size="mini"/>-->
<!-- </el-select>-->
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=15;pageCurrent=1;searchOrder();searchOrder1()">查询</el-button>
<!-- <el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>-->
</div>
<div style="border: 1px solid #EBEEF5;width: 100%;height: 400px;">
<div id="myChart" style="width: 100%;height: 380px;float: right;"/>
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="tableData"
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
:cell-class-name="tableRowClassName"
element-loading-text="数据加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.2)"
class="main"
tooltip-effect="dark"
height="450px"
style="width: 100%;"
border
size="mini">
<el-table-column align="center" width="60px" type="index" label="序号"/>
<el-table-column align="center" label="Id">
<template slot-scope="scope">
{{ scope.row.Id }}
</template>
</el-table-column>
<el-table-column align="center" label="工厂">
<template slot-scope="scope">
{{ scope.row.Factory }}
</template>
</el-table-column>
<el-table-column align="center" label="GPP">
<template slot-scope="scope">
{{ scope.row.GPP }}
</template>
</el-table-column>
<el-table-column align="center" label="NICT">
<template slot-scope="scope">
{{ scope.row.NICT }}
</template>
</el-table-column>
<el-table-column align="center" label="NAT">
<template slot-scope="scope">
{{ scope.row.NAT }}
</template>
</el-table-column>
<el-table-column align="center" label="OEE">
<template slot-scope="scope">
{{ scope.row.OEE }}
</template>
</el-table-column>
<el-table-column align="center" label="OpCode">
<template slot-scope="scope">
{{ scope.row.OpCode }}
</template>
</el-table-column>
<el-table-column align="center" label="OpName">
<template slot-scope="scope">
{{ scope.row.OpName }}
</template>
</el-table-column>
<el-table-column align="center" label="StaticTime">
<template slot-scope="scope">
{{ scope.row.StaticTime }}
</template>
</el-table-column>
<el-table-column align="center" label="CreateTime">
<template slot-scope="scope">
{{ scope.row.CreateTime }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[15, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<!--<script src="../../../utils/setMethods.js"></script>-->
<script>
export default {
data() {
return {
number: [],
tableData: [], // 总数据数组
tableData1: [], // 总数据数组
xData: [], // echars x轴
yData: [], // echars y轴
// engineTypeValue: '', // 产品型号
// engineType: [], // 产品型号数组
// orderNumber: [], // 订单号
// orderNumberValue: '', // 订单号
stationNumberValue: '', // 工位号
stationNumber: [], // 工位号
statePlan: [], // 计划状态数组
statePlanValue: '', // 计划状态
importTime: '', // 计划状态
releaseTime: '', // 计划状态
dateTime: '',
total: 0, // 总条数
pageList: 15, // 每页显示条数
pageSize: 15, // 每页显示条数
pageCurrent: 1, // 后台获取页
mid: [], // id
loading: false,
timer_1: null,
MIDGroup: []
}
},
created() {
var year, month, day, audiTime
this.date = new Date() // 修改数据date
year = new Date().getFullYear()
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
audiTime = year + '-' + month + '-' + day
console.log(audiTime, 'audiTime')
this.dateTime = [audiTime, audiTime]
this.getStationNumber()
},
mounted() {
},
methods: {
// 表格颜色变化
tableRowClassName({ row, rowIndex }) {
// console.log(row, rowIndex)
if (rowIndex % 2 === 0) {
return 'black'
} else {
return 'red'
}
},
// 工位号
getStationNumber() {
this.stationNumber = []
this.xData = []
var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length) this.stationNumberValue = response.data[0].工位号
for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({
label: response.data[i].工位号,
value: response.data[i].工位号
})
this.xData.push(response.data[i].工位号)
}
})
},
// 实时扭矩曲线
drawLine() {
// 基于准备好的dom初始化echarts实例
const myChart = this.$echarts.init(document.getElementById('myChart'))
myChart.clear()
myChart.setOption({
title: {
left: 'center',
text: 'FTT趋势图'
},
toolbox: {// echart保存为图片
show: true,
feature: {
mark: {
show: true
},
saveAsImage: {
show: true,
pixelRatio: 1,
title: '保存为图片',
type: 'png',
lang: ['点击保存']
}
}
},
xAxis: {
type: 'category',
data: this.xData,
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval: 0,
rotate: 30
}
},
yAxis: {
type: 'value'
},
series: [
{
name: 'NO',
data: this.yData,
type: 'line',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: { // 上方显示数值
normal: {
label: {
show: true, // 开启显示
position: 'top', // 在上方显示
textStyle: { // 数值样式
color: 'black',
fontSize: 16
}
}
}
}
}
]
})
},
// 查询订单
searchOrder() {
this.tableData = []
var param = []
param[0] = ['StartTime', this.dateTime[0]]
param[1] = ['EndTime', this.dateTime[1]]
param[2] = ['OpName', this.stationNumberValue]
param[3] = ['PageCurrent', this.pageCurrent]
param[4] = ['PageSize', this.pageSize]
param[5] = ['PageCount', '1111', 'int', '1']
param[6] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', 'Data_WorkStationOEE_Statistic_Form', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) {
this.tableData = response.data.result
}
this.total = parseInt(response.data.output[0].ItemCount)
this.loading = false
})
},
// 查询订单
searchOrder1() {
this.yData = []
this.xData = []
this.tableData1 = []
var param = []
param[0] = ['StartDatetime', this.dateTime[0]]
param[1] = ['EndDatetime', this.dateTime[1]]
param[2] = ['OpDateCode', this.stationNumberValue]
var Data = this.CreateData('11', 'Data_WorkStationOEE_Statistic_Add', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.xData.push((response.data[i].StaticTime).slice(0, 10))
this.yData.push(response.data[i].OEE)
}
console.log(this.xData, 'this.xData')
}
}).then(() => {
this.drawLine()
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchOrder()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchOrder()
}
}
}
</script>
<style scoped>
.topCard{
margin: 5px;
}
.topDiv{
margin-bottom: 10px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
.text {
font-size: 14px;
}
.item {
padding: 18px 0;
}
.box-card {
position: absolute;
right: 6px;
top: 80px;
width: 300px;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@@ -81,12 +81,9 @@
</el-table-column>
<el-table-column align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.订单状态) === 0" effect="plain" style="width: 70px">未上线</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 1" effect="plain" style="width: 70px" type="success">已下发</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 2" effect="plain" style="width: 70px" type="info">进行中</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 1" effect="plain" style="width: 70px" type="success">生产中</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 2" effect="plain" style="width: 70px" type="info">未上线</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 3" effect="plain" style="width: 70px" type="warning">已完成</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 4" effect="plain" style="width: 70px" type="danger">订单禁用</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 5" effect="plain" style="width: 70px" type="danger">订单关闭</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="计划开始时间">
@@ -114,7 +111,7 @@
icon="el-icon-delete"
@click="deleteOrder(scope.row)">删除</el-button>
<el-button
:disabled="parseInt(scope.row.订单状态) !== 0"
:disabled="parseInt(scope.row.订单状态) !== 2"
size="mini"
type="text"
icon="el-icon-success"

View File

@@ -93,12 +93,9 @@
</el-table-column>
<el-table-column align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.订单状态) === 0" effect="plain" style="width: 70px">未上线</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 1" effect="plain" style="width: 70px" type="success">已下发</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 2" effect="plain" style="width: 70px" type="info">进行中</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 1" effect="plain" style="width: 70px" type="success">生产中</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 2" effect="plain" style="width: 70px" type="info">未上线</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 3" effect="plain" style="width: 70px" type="warning">已完成</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 4" effect="plain" style="width: 70px" type="danger">订单禁用</el-tag>
<el-tag v-if="parseInt(scope.row.订单状态) === 5" effect="plain" style="width: 70px" type="danger">订单关闭</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="计划开始时间">