From 48dba5903e4f9299b1beb758f6368f26674caf1f Mon Sep 17 00:00:00 2001 From: yxq Date: Tue, 15 Oct 2024 15:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8C=96=E5=8A=9E=E5=85=AC?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficeEquipment/list.vue | 140 +++++--------- .../OfficeEquipment/single.vue | 171 +++++------------- .../SafetyCheck/list.vue | 6 +- .../SafetyCheck/single.vue | 2 +- 4 files changed, 97 insertions(+), 222 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue index 2ebce5611..6a6c088bd 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/list.vue @@ -16,73 +16,45 @@ {{ displayListItem(item, 'Name') }} - - 处室部门: - {{ displayListItem(item, 'Department') }} + + 处室部门: + {{ displayListItem(item, 'Department') }} - + - 设备编号: - {{ displayListItem(item, 'Code') }} + 设备编号: + {{ displayListItem(item, 'Code') }} - + - 设备名称: - {{ displayListItem(item, 'DeviceName') }} + 设备名称: + {{ displayListItem(item, 'DeviceName') }} - + - 配置描述: - {{ displayListItem(item, 'Description') }} + 配置描述: + {{ displayListItem(item, 'Description') }} - + - 备注: - {{ displayListItem(item, 'Remark') }} + 备注: + {{ displayListItem(item, 'Remark') }} - - - 提交 - - 删除 - 编辑 - - - - 部门审查 - - - - - 分管领导 - - - - - @@ -103,12 +75,16 @@ - + + + + - + @@ -176,31 +152,8 @@ // 数据源 dataSource: { - Status: [{ - text: '草稿', - value: '0' - }, { - text: '部门审查', - value: '1' - }, { - text: '分管领导', - value: '2' - }, { - text: '安全办', - value: '3' - }], - Name: Object.entries(this.GET_GLOBAL('user')).map(e => { - return { - value: e[0], - text: e[1].name - } - }), - Department: Object.entries(this.GET_GLOBAL('department')).map(e => { - return { - value: e[0], - text: e[1].name - } - }) + Name: [], + Department: [] }, // 页面相关参数 @@ -220,16 +173,28 @@ await this.init() }, onUnload() { - this.OFF('EducationalAdministration_SafetyCheck-list-change') + this.OFF('EducationalAdministration_OfficeEquipment-list-change') }, methods: { // 页面初始化 async init() { console.log(this.GET_GLOBAL('user')) - this.ON('EducationalAdministration_SafetyCheck-list-change', this.reset) + this.ON('EducationalAdministration_OfficeEquipment-list-change', this.reset) // 拉取加载列表和数据源 await Promise.all([ + this.FETCH_DATASOURCE('teacheruserdata').then(result => { + this.dataSource.Name = result.data.map(t => ({ + text: t.f_realname, + value: t.f_encode + })); + }), + this.FETCH_DATASOURCE('classdata').then(result => { + this.dataSource.Department = result.data.map(t => ({ + text: t.name, + value: t.id + })); + }), () => {} ]) await this.fetchList() @@ -251,7 +216,7 @@ rows: 10, page: this.page, sord: 'ASC', - sidx:"", + sidx: "", }, queryJson: JSON.stringify(this.searchData) }, @@ -319,33 +284,16 @@ this.NAV_TO('./single?type=create') return - case 'check': - this.NAV_TO(`./single?type=check&id=${id}`) - return - case 'edit': this.NAV_TO(`./single?type=edit&id=${id}`) return - case 'submit': - if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { - return - } - this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/submit', id, '提交失败').then( - success => { - if (!success) { - return - } - this.TOAST('提交成功', 'success') - this.refreshList() - }) - return case 'delete': if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { return } - this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', id, '删除失败').then( + this.HTTP_POST('/Learun/adms/EducationalAdministration/officeEquipment/delete', id, '删除失败').then( success => { if (!success) { return diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue index d302d617d..ddee5ffcf 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/OfficeEquipment/single.vue @@ -1,48 +1,25 @@ @@ -85,85 +62,35 @@ // 表单数据 current: {}, origin: {}, - Status:'', // 表单项数据结构 scheme: { - SafetyCheck: { + OfficeEquipment: { Name: { - type: 'text' + type: 'select',title:'姓名',verify: "NotNull" }, Department: { - type: 'text' - }, - Area: { - type: 'text', - verify: "NotNull", - title: '责任区域' + type: 'select',title:'部门',verify: "NotNull" }, - CheckTime: { - type: 'datetime', - verify: "NotNull", - title: '排查时间', - dateformat:'0' + Code: { + type: 'text',title:'设备编号',verify: "NotNull" }, - Question: { - type: 'text', - verify: "NotNull", - title: '发现的隐患' + DeviceName: { + type: 'text',title:'设备名称',verify: "NotNull" }, - idea: { - type: 'text' - }, - Path: { - type: 'upload' + Description: { + type: 'text',title:'配置描述',verify: "NotNull" }, Remark: { - type: 'text' - }, - // CreateUser: { - // type: 'text' - // }, - // CreateTime: { - // type: 'text' - // }, - // ModifyUser: { - // type: 'text' - // }, - // Modifytime: { - // type: 'text' - // }, - Status: { - type: 'select', - }, - DepartmentRemark: { - type: 'text' - }, + type: 'text',title:'备注' + } }, }, // 数据源 dataSource: { - SafetyCheck: { - // Status: [{ - // text: '草稿', - // value: '0' - // }, { - // text: '部门审查', - // value: '1' - // }, { - // text: '分管领导', - // value: '2' - // }, { - // text: '安全办', - // value: '3' - // }], - Status: [{ - text: '继续上报', - value: '1' - }, { - text: '退回', - value: '0' - }, ], + OfficeEquipment: { + Name: [], + Department: [], }, } @@ -187,6 +114,18 @@ this.edit = ['create', 'edit'].includes(this.mode) // 拉取表单数据,同时拉取所有来自数据源的选单数据 await Promise.all([ + this.FETCH_DATASOURCE('teacheruserdata').then(result => { + this.dataSource.OfficeEquipment.Name = result.data.map(t => ({ + text: t.f_realname, + value: t.f_encode + })); + }), + this.FETCH_DATASOURCE('classdata').then(result => { + this.dataSource.OfficeEquipment.Department = result.data.map(t => ({ + text: t.name, + value: t.id + })); + }), () => {} ]) await this.fetchForm() @@ -200,15 +139,12 @@ if (this.mode === 'create') { this.origin = await this.getDefaultForm() let userInfo = this.GET_GLOBAL('loginUser'); - this.origin.SafetyCheck.Name = userInfo.userId - this.origin.SafetyCheck.Department = userInfo.departmentId + this.origin.OfficeEquipment.Name = userInfo.enCode + this.origin.OfficeEquipment.Department = userInfo.departmentId } else { - const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/SafetyCheck/form', this + const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/officeEquipment/form', + this .id) - this.Status = result.SafetyCheck.Status - if (this.mode === 'check') { - result.SafetyCheck.Status = 1 - } this.origin = await this.formatFormData(result) } this.current = this.COPY(this.origin) @@ -227,7 +163,6 @@ break case 'save': - case 'check': const verifyResult = this.verifyForm() if (verifyResult.length > 0) { this.CONFIRM('表单验证失败', verifyResult.join('\n')) @@ -240,23 +175,14 @@ this.LOADING('正在提交...') const postData = await this.getPostData(this.id) - if(type == 'check'){ - let strEntity = JSON.parse(postData.strEntity) - if(strEntity.Status == 1){ - strEntity.Status = this.Status - } - postData.strEntity = JSON.stringify(strEntity) - } - // console.log(postData,JSON.parse(postData.strEntity)) - this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/' + (type == 'save' ? - 'save' : 'department'), postData, '提交失败') + this.HTTP_POST('/Learun/adms/EducationalAdministration/OfficeEquipment/save', postData, '提交失败') .then(success => { this.HIDE_LOADING() if (!success) { return } - this.EMIT('EducationalAdministration_SafetyCheck-list-change') + this.EMIT('EducationalAdministration_OfficeEquipment-list-change') this.NAV_BACK() this.TOAST('提交成功') }) @@ -268,14 +194,15 @@ } this.LOADING('提交删除中...') - this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', this.id, '删除失败') + this.HTTP_POST('/Learun/adms/EducationalAdministration/OfficeEquipment/delete', this.id, + '删除失败') .then(success => { this.HIDE_LOADING() if (!success) { return } - this.EMIT('EducationalAdministration_SafetyCheck-list-change') + this.EMIT('EducationalAdministration_OfficeEquipment-list-change') this.NAV_BACK() this.this.TOAST('删除成功', 'success') }) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/list.vue index 02c18d5f2..1542a1f74 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/list.vue @@ -12,7 +12,7 @@ - 姓名: + 网络格员: {{ displayListItem(item, 'Name') }} @@ -143,9 +143,9 @@ - - diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/single.vue index 1b06e77f9..19b499e90 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/SafetyCheck/single.vue @@ -2,7 +2,7 @@ + type="user" title="网络格员" required readonly/>