From c1786c305bbf0283dafd823d4b0f51a7b4fdba41 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 13 Mar 2023 15:57:04 +0800 Subject: [PATCH] optimize print page --- .../editExamineStaff/editExamineStaff.html | 24 ++++++ .../editExamineStaff/editExamineStaff.js | 75 ++++++++++++++++++- .../examineStaffManage.html | 12 +++ .../examineStaffManage/examineStaffManage.js | 8 +- .../printPayFeeXiangyun.html | 4 +- 5 files changed, 118 insertions(+), 5 deletions(-) diff --git a/public/pages/examine/editExamineStaff/editExamineStaff.html b/public/pages/examine/editExamineStaff/editExamineStaff.html index 150aeeaac..80e8d8f83 100644 --- a/public/pages/examine/editExamineStaff/editExamineStaff.html +++ b/public/pages/examine/editExamineStaff/editExamineStaff.html @@ -26,6 +26,30 @@ + +
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
diff --git a/public/pages/examine/editExamineStaff/editExamineStaff.js b/public/pages/examine/editExamineStaff/editExamineStaff.js index 8c33168d9..5a3d8fb1a 100644 --- a/public/pages/examine/editExamineStaff/editExamineStaff.js +++ b/public/pages/examine/editExamineStaff/editExamineStaff.js @@ -6,6 +6,9 @@ esId: '', staffName: '', staffId: '', + post: '', + introduction: '', + headerImg: '', allProjects: [], projectIds: [] @@ -13,13 +16,20 @@ }, _initMethod: function() { $that.editExamineStaffInfo.esId = vc.getParam('esId'); + $that._initTextArea(); $that._listExamineProjects(); $that._listExamineStaffs(); }, _initEvent: function() { - + vc.on("editExamineStaff", "notifyUploadImage", function(_param) { + if (_param.length > 0) { + vc.component.editExamineStaffInfo.headerImg = _param[0].fileId; + } else { + vc.component.editExamineStaffInfo.headerImg = '' + } + }); }, methods: { editExamineStaffValidate() { @@ -110,6 +120,10 @@ $that.editExamineStaffInfo.projectIds.push(item.projectId); }); + $(".summernote").summernote('code', vc.component.editExamineStaffInfo.introduction); + var photos = []; + photos.push(vc.component.editExamineStaffInfo.headerImg); + vc.emit('editExamineStaff', 'uploadImageUrl', 'notifyPhotos', photos); }, function(errInfo, error) { console.log('请求失败处理'); @@ -118,7 +132,64 @@ }, _goBack: function() { vc.goBack(); - } + }, + _initTextArea: function() { + var $summernote = $('.summernote').summernote({ + lang: 'zh-CN', + height: 300, + placeholder: '必填,请输入员工简介', + callbacks: { + onImageUpload: function(files, editor, $editable) { + $that.sendFile($summernote, files); + }, + onChange: function(contents, $editable) { + vc.component.editExamineStaffInfo.introduction = contents; + } + }, + toolbar: [ + ['style', ['style']], + ['font', ['bold', 'italic', 'underline', 'clear']], + ['fontname', ['fontname']], + ['color', ['color']], + ['para', ['ul', 'ol', 'paragraph']], + ['height', ['height']], + ['table', ['table']], + ['insert', ['link', 'picture']], + ['view', ['fullscreen', 'codeview']], + ], + }); + }, + sendFile: function($summernote, files) { + console.log('上传图片', files); + var param = new FormData(); + param.append("uploadFile", files[0]); + param.append('communityId', vc.getCurrentCommunity().communityId); + vc.http.upload( + 'uploadFile', + 'uploadImage', + param, { + emulateJSON: true, + //添加请求头 + headers: { + "Content-Type": "multipart/form-data" + } + }, + function(json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + var data = JSON.parse(json); + //关闭model + //$summernote.summernote('insertImage', "/callComponent/download/getFile/file?fileId=" + data.fileId + "&communityId=" + vc.getCurrentCommunity().communityId); + $summernote.summernote('insertImage', data.url); + return; + } + vc.toast(json); + }, + function(errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo); + }); + }, } }); diff --git a/public/pages/examine/examineStaffManage/examineStaffManage.html b/public/pages/examine/examineStaffManage/examineStaffManage.html index 50f416fc5..a1288012b 100644 --- a/public/pages/examine/examineStaffManage/examineStaffManage.html +++ b/public/pages/examine/examineStaffManage/examineStaffManage.html @@ -46,16 +46,27 @@ + + + + @@ -84,5 +95,6 @@ + \ No newline at end of file diff --git a/public/pages/examine/examineStaffManage/examineStaffManage.js b/public/pages/examine/examineStaffManage/examineStaffManage.js index b9d3390ed..ea2aebd6c 100644 --- a/public/pages/examine/examineStaffManage/examineStaffManage.js +++ b/public/pages/examine/examineStaffManage/examineStaffManage.js @@ -78,7 +78,13 @@ } else { vc.component.examineStaffManageInfo.moreCondition = true; } - } + }, + showImg: function(e) { + if (!e) { + e = '/img/noPhoto.jpg'; + } + vc.emit('viewImage', 'showImage', { url: e }); + }, } diff --git a/public/pages/property/printPayFeeXiangyun/printPayFeeXiangyun.html b/public/pages/property/printPayFeeXiangyun/printPayFeeXiangyun.html index e5487094f..368703a17 100644 --- a/public/pages/property/printPayFeeXiangyun/printPayFeeXiangyun.html +++ b/public/pages/property/printPayFeeXiangyun/printPayFeeXiangyun.html @@ -60,7 +60,7 @@ - +
+ +
+
+ + +
+
{{examineStaff.staffId}} {{examineStaff.staffName}}{{examineStaff.post}} {{item.projectName}}, {{printPayFeeInfo.amount}}

@@ -93,4 +93,4 @@ - + \ No newline at end of file