From 99b225e3dc2ced47cfbd927fc875f76196386069 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 23 Feb 2024 11:20:04 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=B7=A1=E6=A3=80=E5=BE=85=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../specialEquipment/check/Content-add.vue | 5 +- .../specialEquipment/check/Content-edit.vue | 235 ++++++------------ src/views/specialEquipment/check/Content.vue | 20 +- 3 files changed, 96 insertions(+), 164 deletions(-) diff --git a/src/views/specialEquipment/check/Content-add.vue b/src/views/specialEquipment/check/Content-add.vue index 9b3ec346..93eae346 100644 --- a/src/views/specialEquipment/check/Content-add.vue +++ b/src/views/specialEquipment/check/Content-add.vue @@ -21,10 +21,7 @@ - + diff --git a/src/views/specialEquipment/check/Content-edit.vue b/src/views/specialEquipment/check/Content-edit.vue index e5a6064a..17a9db2e 100644 --- a/src/views/specialEquipment/check/Content-edit.vue +++ b/src/views/specialEquipment/check/Content-edit.vue @@ -29,41 +29,20 @@ v-loading="formLoading"> - - + - - - - - - + v-model="form.name" + placeholder="请输入巡检单名称" /> - + :placeholder="`请选择部门`"> - - + + + + + + + + + @@ -94,112 +97,25 @@ - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - 保养内容 + 巡检内容
- 添加属性 + 添加内容
({ - id: item.id, - label: item.name, - value: item.id, - })); - }, - maintainerOptions() { - return (this.maintainerList || []).map((item) => ({ - id: item.id, - label: item.name, - value: item.name, - })); - }, }, mounted() { - this.getList('maintainer'); this.getList('department'); - this.getList('line'); + this.getList('groupClass'); + this.getList('inspector'); }, methods: { handleSearchBarBtnClick(btn) { @@ -480,10 +382,11 @@ export default { }, init(row) { + console.log('row', row); this.visible = true; this.row = row; - this.getInfo(row); - this.getAttrList(row); + // this.getInfo(row); + // this.getAttrList(row); }, async getInfo(row) { @@ -521,22 +424,42 @@ export default { async getList(source = 'department') { const urls = [ - '/base/core-production-line/listAll', '/base/core-department/listAll', - '/base/core-worker/listAll', + '/base/group-classes/listAll', ]; let res; switch (source) { case 'department': - res = await this.$axios(urls[1]); + res = await this.$axios(urls[0]); this.departmentList = res.data || []; break; - case 'maintainer': - res = await this.$axios(urls[2]); - this.maintainerList = res.data || []; + case 'inspector': + let inspectorList = []; + const userlist = await this.$axios({ + url: '/system/user/page', + params: { pageNo: 1, pageSize: 100 }, + }); + if (userlist.code == 0) { + inspectorList = inspectorList.concat( + (userlist.data?.list || []).map((item) => ({ + label: item.username, + value: item.id, + })) + ); + } + const workerlist = await this.$axios('/base/core-worker/listAll'); + if (workerlist.code == 0) { + inspectorList = inspectorList.concat( + workerlist.data.map((item) => ({ + label: item.name, + value: item.id, + })) + ); + } + this.inspectorOptions = inspectorList; break; - case 'line': - res = await this.$axios(urls[0]); + case 'groupClass': + res = await this.$axios(urls[1]); this.lineList = res.data || []; break; } diff --git a/src/views/specialEquipment/check/Content.vue b/src/views/specialEquipment/check/Content.vue index dc803ad4..3c8c66fe 100644 --- a/src/views/specialEquipment/check/Content.vue +++ b/src/views/specialEquipment/check/Content.vue @@ -57,11 +57,18 @@ @confirm="handleSubmit"> + + + @@ -71,13 +78,15 @@ import addOrUpdata from './add-or-updata.vue'; import add from './Content-add.vue'; import { parseTime } from '../../core/mixins/code-filter'; import CheckOrderListTable from './CheckOrderListTable.vue'; +import edit from './Content-edit.vue'; export default { name: 'SpecialEquipmentCheckConfig', - components: { addOrUpdata, add, CheckOrderListTable }, + components: { addOrUpdata, add, edit, CheckOrderListTable }, mixins: [basicPageMixin], data() { return { + editOpen: false, addOrUpdateVisible: false, addOrEditTitle: '', searchBarKeys: ['name'], @@ -307,7 +316,12 @@ export default { }); }, /** 编辑 */ - handleEdit(row) {}, + handleEdit(row) { + this.editOpen = true; + this.$nextTick(() => { + this.$refs['content-edit'].init(row); + }); + }, /** 确认巡检单 */ handleConfirm(row) {}, /** 删除巡检单 */ @@ -376,5 +390,3 @@ export default { }, }; - - \ No newline at end of file