From 5b9a1d6cb3a7d59c8f2de83c495bba1a069b2723 Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期五, 19 一月 2024 00:23:15 +0800 Subject: [PATCH] update --- src/container/maintenance/index.vue | 60 +++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/container/maintenance/index.vue b/src/container/maintenance/index.vue index e861d9e..f768474 100644 --- a/src/container/maintenance/index.vue +++ b/src/container/maintenance/index.vue @@ -1,7 +1,7 @@ <!-- * @Date: 2024-01-06 17:40:19 * @LastEditors: Sneed - * @LastEditTime: 2024-01-14 16:13:57 + * @LastEditTime: 2024-01-19 00:15:38 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/maintenance/index.vue --> <template> @@ -11,12 +11,12 @@ <template slot="search"> <div class="item"> <span>缁熶竴缂栧彿</span> - <el-input class="item-value" v-model="queryInfo.uuid"></el-input> + <el-input class="item-value" v-model="queryInfo.uuid" clearable></el-input> </div> <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-select class="item-value" v-model="queryInfo.machineName" placeholder="璇烽�夋嫨" clearable> + <el-option v-for="item in machineList" :key="item.id" :label="item.machineName" :value="item.id"> </el-option> </el-select> </div> @@ -30,7 +30,7 @@ </div> --> <div class="item"> <span>浣跨敤閮ㄩ棬</span> - <el-select class="item-value" v-model="queryInfo.department"> + <el-select class="item-value" v-model="queryInfo.department" clearable> <el-option v-for="item in departmentlist" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -41,18 +41,16 @@ </div> --> <div class="item"> <span>璁″垝寮�濮嬫棩鏈�</span> - <el-date-picker class="item-value" v-model="queryInfo.planStartDate" align="right" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-date-picker class="item-value" clearable v-model="queryInfo.planStartDate" align="right" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </div> <div class="item"> <span>璁″垝瀹屾垚鏃ユ湡</span> - <el-date-picker class="item-value" v-model="queryInfo.planFinishDate" align="right" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-date-picker class="item-value" clearable v-model="queryInfo.planFinishDate" align="right" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </div> - <div class="item"> + <div class="item" style="flex: 1 1 auto;justify-content: flex-end;"> <el-button type="primary" size="small" @click="query">鏌ヨ</el-button> - </div> - <div class="item"> <el-button type="primary" size="small" @click="reset">閲嶇疆</el-button> </div> </template> @@ -108,18 +106,17 @@ <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="query" :styleValue="queryInfo.style" :styleName="navName" :departmentlist="departmentlist" :machineList="machineList" :userList="userList"></DailyMAddD> </div> </template> <script> import List from '../list/index.vue' import { getUseDpts,getRequest } from '@/api/Api' -import { userList } from '@/api/MdcApi' import DailyMAddD from './dailyMAdd.vue' export default { components: { @@ -128,8 +125,14 @@ }, computed: { navName () { - let names = ['鏃ュ父淇濆吇','涓�绾�','浜岀骇','涓夌骇'] - return names[this.$route.params.style-1] + let names = ['鏃ュ父淇濆吇','涓�绾т繚鍏�','浜岀骇淇濆吇','涓夌骇淇濆吇'] + return names[this.$route.params.style-1] + }, + }, + watch: { + $route () { + this.queryInfo.style = this.$route.params.style + this.query() } }, data() { @@ -140,6 +143,7 @@ queryInfo: { uuid: '', machineName: '', + style: 1, type: '', specification: '', department: '', @@ -172,9 +176,10 @@ }) getRequest('userList', { }).then(res => { - this.userList = res.data.list + this.userList = res.data }) }, + query() { this.$refs.list.pageQuery(this.queryInfo) }, @@ -184,7 +189,7 @@ }) }, addDevice(n, row, event) { - if (n === 1) { + if (n === 1) {//娣诲姞 this.$nextTick(() => { this.$refs.dailyMAddD.init(n) }) @@ -194,8 +199,25 @@ }) } }, - 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() { -- Gitblit v1.9.3