| | |
| | | <!-- |
| | | * @Date: 2024-01-06 17:40:19 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-12 22:44:37 |
| | | * @LastEditTime: 2024-01-13 11:35:29 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/deviceType/index.vue |
| | | --> |
| | | <template> |
| | | <div class="maintenance"> |
| | | <div class="nav">设备保养/日常保养</div> |
| | | <List ref="list" url="/component/pageQuery"> |
| | | <div class="nav">设备类型管理</div> |
| | | <List ref="list" :url="url"> |
| | | <template slot="search"> |
| | | <div class="item"> |
| | | <span>零件号</span> |
| | | <el-select class="item-value" v-model="queryInfo.component" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in componentList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <span>名称</span> |
| | | <el-input class="item-value" v-model="queryInfo.name"></el-input> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div class="item"> |
| | | <el-button type="primary" size="small" @click="query">查询</el-button> |
| | | </div> |
| | | <div class="item"> |
| | | <span>工序号</span> |
| | | <!-- <el-input class="item-value" v-model="query.no"></el-input> --> |
| | | <el-select class="item-value" v-model="queryInfo.precess" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in precessList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="item"> |
| | | <span>开始时间</span> |
| | | <!-- <el-input class="item-value" v-model="query.no"></el-input> --> |
| | | <el-date-picker |
| | | class="item-value" |
| | | v-model="queryInfo.timeBegin" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="item"> |
| | | <span>结束时间</span> |
| | | <el-date-picker |
| | | class="item-value" |
| | | v-model="queryInfo.timeEnd" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="query btn" @click="query">查询</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="reset btn" @click="reset">重置</div> |
| | | <el-button type="primary" size="small" @click="reset">重置</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | <template slot="table-tool"> |
| | | <el-button type="primary" size="mini" @click="add">添加设备类型</el-button> |
| | | </template> |
| | | |
| | | <template slot="columns"> |
| | | <el-table-column |
| | | prop="date" |
| | | label="机床名" |
| | | <el-table-column |
| | | prop="id" |
| | | label="ID" |
| | | width="180"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="component" |
| | | label="零件号" |
| | | prop="name" |
| | | label="名称" |
| | | width="180"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="工序号"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="加工时间"> |
| | | <el-table-column align="center" label="操作" prop="editor"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" @click="editDeviceType(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" @click="deleteHandle(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | |
| | | </List> |
| | | <manage-add-update v-if="addOrUpdateVisible" :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm" |
| | | :row="row"></manage-add-update> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import List from '../list/index.vue' |
| | | import ManageAddUpdate from './Manage-add-update' |
| | | import { getUrl,deviceTypeDelete } from '@/api/Api' |
| | | export default { |
| | | components: { |
| | | List |
| | | List, |
| | | ManageAddUpdate |
| | | }, |
| | | data () { |
| | | return { |
| | | url: '', |
| | | queryInfo: { |
| | | timeBegin: '', |
| | | timeEnd: '', |
| | | precess: '', |
| | | component: '' |
| | | name: '' |
| | | }, |
| | | precessList: [], |
| | | componentList: [] |
| | | row: {}, |
| | | addOrUpdateVisible: false |
| | | } |
| | | }, |
| | | created () { |
| | | this.init() |
| | | // this.getProtocolList() |
| | | this.url = getUrl('deviceTypeQuery') |
| | | //this.init() |
| | | }, |
| | | methods: { |
| | | reset () { |
| | |
| | | query () { |
| | | this.$refs.list.pageQuery(this.queryInfo) |
| | | }, |
| | | changeTime (name,value) { |
| | | console.log(name,value) |
| | | this.queryInfo[name] = value |
| | | }, |
| | | init () { |
| | | this.$http.get('/component/processlist').then(res => { |
| | | this.precessList = res.data |
| | | }) |
| | | this.$http.post('/component/complist').then(res => { |
| | | this.componentList = res.data |
| | | }) |
| | | } |
| | | add() { |
| | | this.row = {id:''} |
| | | this.addOrUpdateVisible = true |
| | | |
| | | }, |
| | | editDeviceType(row){ |
| | | this.row = row; |
| | | this.addOrUpdateVisible = true; |
| | | }, |
| | | close() { |
| | | this.addOrUpdateVisible = false |
| | | }, |
| | | confirm() { |
| | | this.query() |
| | | this.close() |
| | | }, |
| | | addOrUpdateHandle(row) { |
| | | this.row = row |
| | | this.addOrUpdateVisible = true |
| | | }, |
| | | deleteHandle(row) { |
| | | let ids = [] |
| | | |
| | | ids.push(row.id) |
| | | |
| | | ids = ids.join(',') |
| | | this.$confirm('确定要永久删除此项?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deviceTypeDelete(ids).then(res => { |
| | | // if(res.result == ""){} |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }) |
| | | this.submitForm() |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | border: 1px solid #435F9E; |
| | | } |
| | | } |
| | | .el-button--mini { |
| | | background: transparent; |
| | | } |
| | | .el-button--primary { |
| | | background-color: transparent; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="scss" scoped> |
| | | .maintenance { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | color: #FFF; |
| | | .maintenance { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | color: #FFF; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .nav { |
| | | padding: 10px 30px; |
| | | } |
| | | |
| | | .item { |
| | | margin-top: 20px; |
| | | margin-left: 50px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .nav { |
| | | padding: 10px 30px; |
| | | align-items: center; |
| | | |
| | | span { |
| | | width: 120px; |
| | | font-size: 16px; |
| | | font-family: PingFangSC, PingFang SC; |
| | | color: #C6DCE0; |
| | | text-align: right; |
| | | padding-right: 20px; |
| | | } |
| | | .item { |
| | | margin-top: 20px; |
| | | margin-left: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | span { |
| | | width: 120px; |
| | | font-size: 16px; |
| | | font-family: PingFangSC, PingFang SC; |
| | | color: #C6DCE0; |
| | | text-align: right; |
| | | padding-right: 20px; |
| | | } |
| | | .item-value { |
| | | width: 200px; |
| | | border: 1px solid #435F9E; |
| | | } |
| | | .btn { |
| | | line-height: 1.5; |
| | | width: 100px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | } |
| | | .reset { |
| | | background: #AAB6BA; |
| | | color: #FFF; |
| | | } |
| | | .query { |
| | | background: #5DD1FC; |
| | | color: #FFF; |
| | | } |
| | | |
| | | .item-value { |
| | | width: 200px; |
| | | border: 1px solid #435F9E; |
| | | } |
| | | |
| | | .btn { |
| | | line-height: 1.5; |
| | | width: 100px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .reset { |
| | | background: #AAB6BA; |
| | | color: #FFF; |
| | | } |
| | | |
| | | .query { |
| | | background: #5DD1FC; |
| | | color: #FFF; |
| | | } |
| | | } |
| | | } |
| | | </style> |