保养信息维护
This commit is contained in:
35
src/api/ManufacturingCenter/maintainInformation.js
Normal file
35
src/api/ManufacturingCenter/maintainInformation.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取工位 表1
|
||||
export function getTableData1() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: 'SELECT *FROM [基础数据_设备工位点检表]inner join dbo.基础数据_点检类型名称 on [基础数据_设备工位点检表].点检表类型 = 基础数据_点检类型名称.点检表类型流水号'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 点检类型 表2
|
||||
export function getTableData2() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: 'select * from 基础数据_点检类型名称'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 点检内容 表3
|
||||
export function getTableData3(num) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: `select * from 基础数据_点检内容 where 点检表类型 = ${num}`
|
||||
}
|
||||
})
|
||||
}
|
||||
127
src/views/ManufacturingCenter/maintainInformation/index.vue
Normal file
127
src/views/ManufacturingCenter/maintainInformation/index.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div>设备对应点检类型维护</div>
|
||||
<el-table v-loading="loading1" :data="tableData1" height="200" highlight-current-row 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">
|
||||
<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>
|
||||
<div>点检类型、点检内容维护</div>
|
||||
<el-col :span="6">
|
||||
<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">
|
||||
{{ scope.row.点检表类型名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<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">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="保养项目" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.保养项目 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTableData1, getTableData2, getTableData3 } from '@/api/ManufacturingCenter/maintainInformation'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
点检表类型: [],
|
||||
tableData1: [],
|
||||
loading1: false,
|
||||
tableData2: [],
|
||||
loading2: false,
|
||||
tableData3: [],
|
||||
loading3: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableData1()
|
||||
this.getTableData2()
|
||||
},
|
||||
methods: {
|
||||
getTableData1() {
|
||||
this.loading1 = true
|
||||
getTableData1().then(response => {
|
||||
this.tableData1 = response.data
|
||||
this.loading1 = false
|
||||
})
|
||||
},
|
||||
getTableData2() {
|
||||
this.点检表类型 = []
|
||||
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].点检表类型流水号
|
||||
})
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
this.loading2 = false
|
||||
})
|
||||
},
|
||||
getTableData3(row) {
|
||||
this.loading3 = true
|
||||
getTableData3(row.点检表类型流水号).then(response => {
|
||||
this.tableData3 = response.data
|
||||
this.loading3 = false
|
||||
})
|
||||
},
|
||||
editType() {
|
||||
console.log(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user