optimize print page

This commit is contained in:
java110 2023-03-13 15:57:04 +08:00
parent 79e8d8a2bf
commit c1786c305b
5 changed files with 118 additions and 5 deletions

View File

@ -26,6 +26,30 @@
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">
<vc:i18n name="员工头像" namespace="editExamineStaff"></vc:i18n>
</label>
<div class="col-sm-10">
<vc:create path="frame/uploadImageUrl" callBackListener="editExamineStaff" callBackFunction="notifyUploadImage" imageCount="1" namespace="editExamineStaff">
</vc:create>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right"><span><vc:i18n name='员工岗位' namespace='editExamineStaff'></vc:i18n></span></label>
<div class="col-sm-6">
<input v-model="editExamineStaffInfo.post" type="text" :placeholder="vc.i18n('必填,请填写员工岗位','editExamineStaff')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right"><span><vc:i18n name='员工简介' namespace='editExamineStaff'></vc:i18n></span></label>
<div class="col-sm-6">
<div class="no-padding">
<div class="summernote"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">

View File

@ -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);
});
},
}
});

View File

@ -46,16 +46,27 @@
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center"><span>
<vc:i18n name='人脸' namespace='examineStaffManage'></vc:i18n>
</span></th>
<th class="text-center"><span><vc:i18n name='员工编号' namespace='examineStaffManage'></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name='员工名称' namespace='examineStaffManage'></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name='岗位' namespace='examineStaffManage'></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name='考核项目' namespace='examineStaffManage'></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name='操作'></vc:i18n></span></th>
</tr>
</thead>
<tbody>
<tr v-for="examineStaff in examineStaffManageInfo.examineStaffs">
<td class="text-center">
<div style="position: relative; display: inline-block;" v-on:click="showImg(examineStaff.headerImg?examineStaff.headerImg:'/img/noPhoto.jpg')">
<img width="50" height="50" v-bind:src="examineStaff.headerImg?examineStaff.headerImg:'/img/noPhoto.jpg'" onerror="this.src='/img/noPhoto.jpg';">
<img src="/img/icon-bigimg.png" style="position: absolute;right: 0;bottom: 0;" width="50" height="50" alt="">
</div>
</td>
<td class="text-center">{{examineStaff.staffId}}</td>
<td class="text-center">{{examineStaff.staffName}}</td>
<td class="text-center">{{examineStaff.post}}</td>
<td class="text-center">
<span v-for="(item,index) in examineStaff.projects">{{item.projectName}},</span>
</td>
@ -84,5 +95,6 @@
</div>
</div>
<vc:create path="examine/deleteExamineStaff"></vc:create>
<vc:create path="common/viewImage"></vc:create>
</div>

View File

@ -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 });
},
}

View File

@ -60,7 +60,7 @@
</td>
<td colspan="3" class="text-center ">{{printPayFeeInfo.amount}}</td>
</tr>
<tr height="60px">
<tr height="60px" v-if="printPayFeeInfo.content || printPayFeeInfo.qrImg">
<td colspan="6">
<p style="max-width: 600px;">
<!-- {{printPayFeeInfo.content}} -->
@ -93,4 +93,4 @@
</div>
</div>
</div>
</div>
</div>