Commit 9d003fc3 authored by 李志鸣's avatar 李志鸣

fea(车道基础数据): 功能联调

parent 1bc4198c
<template> <template>
<el-dialog <el-dialog
title="新增设备信息" title="新增设备基础数据"
:visible.sync="dialogToggle" :visible.sync="dialogToggle"
:show-close="false" :show-close="false"
:close-on-press-escape="false" :close-on-press-escape="false"
......
<template> <template>
<el-dialog <el-dialog
title="编辑设备信息" title="编辑设备基础数据"
:visible.sync="dialogToggle" :visible.sync="dialogToggle"
:show-close="false" :show-close="false"
:close-on-press-escape="false" :close-on-press-escape="false"
......
...@@ -113,7 +113,11 @@ ...@@ -113,7 +113,11 @@
}, },
methods: { methods: {
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, doRefreshClick () {
this.getTableList().then(response => {
this.$message.sucess('刷新成功!')
})
},
// 点击搜索组件搜索按钮 // 点击搜索组件搜索按钮
doSearchClick (searchValue) { doSearchClick (searchValue) {
this.searchList = searchValue this.searchList = searchValue
......
<template>
<el-dialog
title="新增车道基础数据"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="600px">
<el-form
label-width="100px"
label-position="top"
:model="formData"
ref="form"
:rules="formRules">
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :loading="loadingToggle" size="small" type="primary" icon="el-icon-check" @click="doConfirmClick('form')">确认</el-button>
<el-button size="small" icon="el-icon-close" @click="doCancelClick('form')">取消</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
watch: {
dialogToggle (newVal, oldVal) {
// 获取车间下拉数据
this.getWorkshopSelectData()
}
},
data () {
return {
// 数据提交开关标识
loadingToggle: false,
// 对话框开关标识
dialogToggle: false,
// 表单数据
formData: {},
// 表单正则
formRules: {},
// 车间下拉数据
workShopSelectData: []
}
},
methods: {
// 点击确认按钮
doConfirmClick () {},
// 点击取消按钮
doCancelClick () {},
// 获取车间下拉数据
getWorkshopSelectData () {
let queryParams = { dicCode: 'WORKSHOP_LIST', hash: 'dicCode' }
this.$fetch('dict-item-controller/dicCode-get', queryParams).then(response => {
this.workShopSelectData = _.cloneDeep(response)
})
}
}
}
</script>
<style>
</style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<span class="page-title-text">车道基础数据</span> <span class="page-title-text">车道基础数据</span>
</div> </div>
<div class="float-right page-refresh"> <div class="float-right page-refresh">
<span @click="doRefreshClick()" class="pointer"> <span @click="doRefreshClick" class="pointer">
<svg-icon icon-class="refresh"></svg-icon> <svg-icon icon-class="refresh"></svg-icon>
<span class="ml-10">刷新</span> <span class="ml-10">刷新</span>
</span> </span>
...@@ -13,14 +13,15 @@ ...@@ -13,14 +13,15 @@
</div> </div>
<div class="tool-pack clear-float pl-15 pr-15"> <div class="tool-pack clear-float pl-15 pr-15">
<Search <Search
searchCode="MATERIEL_RECORD" searchCode="PAINTSHOP_STATION"
@search="doSearchClick" @search="doSearchClick"
@reset="doResetClick"> @reset="doResetClick">
</Search> </Search>
<div class="float-left"> <div class="float-left">
<el-button <el-button
size="small" size="small"
type="primary"> type="primary"
@click="doAddClick">
新增 新增
</el-button> </el-button>
</div> </div>
...@@ -28,30 +29,82 @@ ...@@ -28,30 +29,82 @@
<div class="general-list-main-pack pl-15 pr-15"> <div class="general-list-main-pack pl-15 pr-15">
<div> <div>
<Table <Table
:tableConfig="tableConfig"> :tableConfig="tableConfig"
@onPageSizeChange="onPageSizeChange"
@onCurrentPageChange="onCurrentPageChange">
<template slot="keyStation">
<el-table-column
label="是否为关键工位"
width="200">
<template slot-scope="scope">
<el-tag
v-if="scope.row.keyStation"
type="success">
</el-tag>
<el-tag v-else
type="info">
</el-tag>
</template>
</el-table-column>
</template>
<template slot="operationColumn">
<el-table-column
fixed="right"
width="100"
label="操作">
<template slot-scope="scope">
<el-button
type="text">
编辑
</el-button>
<el-button
type="text"
style="color: rgb(244, 116, 118)">
删除
</el-button>
</template>
</el-table-column>
</template>
</Table> </Table>
</div> </div>
</div> </div>
<!--新增车道基础信息对话框-->
<AddLaneDialog
ref="AddLaneDialog">
</AddLaneDialog>
</div> </div>
</template> </template>
<script> <script>
import Table from '@/components/Table/index.vue' import Table from '@/components/Table/index.vue'
import Search from '@/components/Search' import Search from '@/components/Search'
import AddLaneDialog from './components/AddLaneDialog'
export default { export default {
name: 'LaneBasic', name: 'LaneBasic',
components: { components: {
Search, Search,
Table Table,
AddLaneDialog
}, },
data () { data () {
return { return {
// 精准搜索关键字列表
searchList: {},
// 表格配置项 // 表格配置项
tableConfig: { tableConfig: {
height: 0, height: 0,
data: [], data: [],
fieldList: [], fieldList: [
{ label: '车间', value: 'workshopCode' },
{ label: '区域', value: 'areaName' },
{ label: '车道编号', value: 'laneCode' },
{ label: '工位编号', value: 'code' },
{ label: '是否为关键工位', value: 'keyStation', slot: 'keyStation' }
],
paginationToggle: true, paginationToggle: true,
paginationConfig: { paginationConfig: {
total: 0, total: 0,
...@@ -63,15 +116,73 @@ ...@@ -63,15 +116,73 @@
}, },
methods: { methods: {
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, doRefreshClick () {
this.getTableList().then(response => {
this.$message.success('刷新成功!')
})
},
// 表格组件分页数量改变事件
onPageSizeChange (pageSize) {
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = pageSize
// 获取表格数据
this.getTableList()
},
// 表格组件分页页数改变事件
onCurrentPageChange (currentPage) {
this.tableConfig.paginationConfig.currentPage = currentPage
// 获取表格数据
this.getTableList()
},
// 点击搜索组件搜索按钮 // 点击搜索组件搜索按钮
doSearchClick () {}, doSearchClick (searchValue) {
this.searchList = searchValue
this.tableConfig.paginationConfig.currentPage = 1
// 获取表格数据
this.getTableList()
},
// 点击搜索组件重置按钮 // 点击搜索组件重置按钮
doResetClick () {} doResetClick (searchValue) {
this.searchList = { ...searchValue, filters: [] }
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = 20
// 获取表格数据
this.getTableList()
},
// 获取表格数据
getTableList () {
let queryParams = {
searchCode: this.searchList.searchCode || 'PAINTSHOP_STATION',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
}
return new Promise((resolve, reject) => {
this.$fetch('basic-info-controller/stationPage-post', queryParams).then(response => {
if (response.list.length === 0 && response.pageNum !== 1) {
this.tableConfig.paginationConfig.currentPage -= 1
// 获取表格数据
this.getTableList()
} else {
this.tableConfig.data = _.cloneDeep(response.list)
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total)
resolve()
}
}).catch(error => {
reject(error)
})
})
},
// 点击新增按钮
doAddClick () {
this.$refs.AddLaneDialog.dialogToggle = true
}
}, },
mounted () { mounted () {
setTimeout(() => { setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 210 this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 210
// 获取表格数据
this.getTableList()
}, 0) }, 0)
} }
} }
...@@ -84,6 +195,7 @@ ...@@ -84,6 +195,7 @@
width: 100%; width: 100%;
border: 1px solid #d2d3d5; border: 1px solid #d2d3d5;
background-color: #fff; background-color: #fff;
overflow-y: auto;
.title-pack { .title-pack {
height: 38px; height: 38px;
...@@ -158,4 +270,4 @@ ...@@ -158,4 +270,4 @@
} }
} }
} }
</style> </style>
\ No newline at end of file
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