| | |
| | | <!-- |
| | | * @Date: 2024-01-06 17:40:19 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-14 16:13:57 |
| | | * @LastEditTime: 2024-01-14 18:55:28 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/maintenance/index.vue |
| | | --> |
| | | <template> |
| | |
| | | <div class="item"> |
| | | <span>设备名称</span> |
| | | <el-select class="item-value" v-model="queryInfo.machineName" placeholder="请选择"> |
| | | <el-option v-for="item in machineList" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-option v-for="item in machineList" :key="item.id" :label="item.machineName" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | <el-table-column align="center" label="操作" prop="editor"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" @click="addDevice(2, scope.row, $event)">编辑</el-button> |
| | | <el-button size="mini" type="text" @click="deleteHandle(2, scope.row)">删除</el-button> |
| | | <el-button size="mini" type="text" @click="deleteHandle(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </List> |
| | | <DailyMAddD ref="dailyMAddD" @reflash="submitForm" :style="navName" :departmentlist="departmentlist" :machineList="machineList" :userList="userList"></DailyMAddD> |
| | | <DailyMAddD ref="dailyMAddD" @reflash="submitForm" :styleValue="getStyle" :styleName="navName" :departmentlist="departmentlist" :machineList="machineList" :userList="userList"></DailyMAddD> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | }, |
| | | computed: { |
| | | navName () { |
| | | let names = ['日常保养','一级','二级','三级'] |
| | | return names[this.$route.params.style-1] |
| | | let names = ['日常保养','一级保养','二级保养','三级保养'] |
| | | return names[this.$route.params.style-1] |
| | | }, |
| | | |
| | | getStyle () { |
| | | return this.$route.params.style; |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | queryInfo: { |
| | | uuid: '', |
| | | machineName: '', |
| | | style: this.$route.params.style, |
| | | type: '', |
| | | specification: '', |
| | | department: '', |
| | |
| | | this.userList = res.data.list |
| | | }) |
| | | }, |
| | | |
| | | query() { |
| | | this.$refs.list.pageQuery(this.queryInfo) |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | addDevice(n, row, event) { |
| | | if (n === 1) { |
| | | if (n === 1) {//添加 |
| | | this.$nextTick(() => { |
| | | this.$refs.dailyMAddD.init(n) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | }, |
| | | deleteHandle() { |
| | | |
| | | deleteHandle(row) { |
| | | this.$confirm('确定要永久删除此项?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | getRequest('maintainDel', { ids: [row.id] }).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }) |
| | | this.query(); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | submitForm() { |
| | | |