mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 18:11:00 +08:00
wanchegn zuimeiyuangong edit
This commit is contained in:
parent
42b184a4e2
commit
d78fb14331
@ -41,10 +41,10 @@
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">员工编号</label>
|
||||
<label class="col-sm-2 col-form-label">评选编号</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addActivitiesBeautifulStaffInfo.activitiesNum" type="text"
|
||||
placeholder="必填,请填写员工编号" class="form-control">
|
||||
placeholder="必填,请填写评选编号" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
@ -1,46 +1,40 @@
|
||||
<div id = "editActivitiesBeautifulStaffModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" >
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">修改最美员工</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">活动规则</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editActivitiesBeautifulStaffInfo.ruleId">
|
||||
<option selected disabled value="">必填,请选择活动规则</option>
|
||||
<option value="6666">最美员工</option>
|
||||
</select> </div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">员工</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editActivitiesBeautifulStaffInfo.staffId" type="text" placeholder="必填,请填写员工" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">员工编号</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editActivitiesBeautifulStaffInfo.activitiesNum" type="text" placeholder="必填,请填写员工编号" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">工作简介</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editActivitiesBeautifulStaffInfo.workContent" type="text" placeholder="必填,请填写工作简介" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<h5>编辑</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editActivitiesBeautifulStaff()" ><i class="fa fa-check"></i> 保存</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">员工编号</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editActivitiesBeautifulStaffInfo.activitiesNum" type="text"
|
||||
placeholder="必填,请填写员工编号" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">工作简介</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="no-padding">
|
||||
<div class="editSummernote"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="editActivitiesBeautifulStaff()"><i class="fa fa-check"></i> 保存</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
@click="_closeEditActivitiesBeauifulStaffInfo()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,129 +1,196 @@
|
||||
(function(vc,vm){
|
||||
(function (vc, vm) {
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
editActivitiesBeautifulStaffInfo:{
|
||||
beId:'',
|
||||
ruleId:'',
|
||||
staffId:'',
|
||||
activitiesNum:'',
|
||||
workContent:'',
|
||||
data: {
|
||||
editActivitiesBeautifulStaffInfo: {
|
||||
beId: '',
|
||||
ruleId: '',
|
||||
staffId: '',
|
||||
activitiesNum: '',
|
||||
workContent: '',
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('editActivitiesBeautifulStaff','openEditActivitiesBeautifulStaffModal',function(_params){
|
||||
$that._initEditActivitiesBeautifulStaffInfo();
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editActivitiesBeautifulStaff', 'openEditActivitiesBeautifulStaffModal', function (_params) {
|
||||
vc.component.refreshEditActivitiesBeautifulStaffInfo();
|
||||
$('#editActivitiesBeautifulStaffModel').modal('show');
|
||||
vc.copyObject(_params, vc.component.editActivitiesBeautifulStaffInfo );
|
||||
vc.copyObject(_params, vc.component.editActivitiesBeautifulStaffInfo);
|
||||
$(".editSummernote").summernote('code', vc.component.editActivitiesBeautifulStaffInfo.workContent);
|
||||
vc.component.editActivitiesBeautifulStaffInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
editActivitiesBeautifulStaffValidate:function(){
|
||||
return vc.validate.validate({
|
||||
editActivitiesBeautifulStaffInfo:vc.component.editActivitiesBeautifulStaffInfo
|
||||
},{
|
||||
'editActivitiesBeautifulStaffInfo.ruleId':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"活动规则不能为空"
|
||||
methods: {
|
||||
editActivitiesBeautifulStaffValidate: function () {
|
||||
return vc.validate.validate({
|
||||
editActivitiesBeautifulStaffInfo: vc.component.editActivitiesBeautifulStaffInfo
|
||||
}, {
|
||||
'editActivitiesBeautifulStaffInfo.ruleId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "活动规则不能为空"
|
||||
},
|
||||
{
|
||||
limit:"num",
|
||||
param:"",
|
||||
errInfo:"活动规则格式错误"
|
||||
{
|
||||
limit: "num",
|
||||
param: "",
|
||||
errInfo: "活动规则格式错误"
|
||||
},
|
||||
],
|
||||
'editActivitiesBeautifulStaffInfo.staffId':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"员工不能为空"
|
||||
'editActivitiesBeautifulStaffInfo.staffId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "员工不能为空"
|
||||
},
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"128",
|
||||
errInfo:"员工名称太长"
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "128",
|
||||
errInfo: "员工名称太长"
|
||||
},
|
||||
],
|
||||
'editActivitiesBeautifulStaffInfo.activitiesNum':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"员工编号不能为空"
|
||||
'editActivitiesBeautifulStaffInfo.activitiesNum': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "员工编号不能为空"
|
||||
},
|
||||
{
|
||||
limit:"num",
|
||||
param:"",
|
||||
errInfo:"编号必须为数字"
|
||||
{
|
||||
limit: "num",
|
||||
param: "",
|
||||
errInfo: "编号必须为数字"
|
||||
},
|
||||
],
|
||||
'editActivitiesBeautifulStaffInfo.workContent':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"工作简介不能为空"
|
||||
'editActivitiesBeautifulStaffInfo.workContent': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "工作简介不能为空"
|
||||
},
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"1024",
|
||||
errInfo:"工作简介说明太长"
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "1024",
|
||||
errInfo: "工作简介说明太长"
|
||||
},
|
||||
],
|
||||
'editActivitiesBeautifulStaffInfo.beId':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"ID不能为空"
|
||||
'editActivitiesBeautifulStaffInfo.beId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "ID不能为空"
|
||||
}]
|
||||
|
||||
});
|
||||
},
|
||||
editActivitiesBeautifulStaff:function(){
|
||||
if(!vc.component.editActivitiesBeautifulStaffValidate()){
|
||||
});
|
||||
},
|
||||
editActivitiesBeautifulStaff: function () {
|
||||
if (!vc.component.editActivitiesBeautifulStaffValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'activitiesBeautifulStaff.updateActivitiesBeautifulStaff',
|
||||
'/activitiesRule/updateActivitiesBeautifulStaff',
|
||||
JSON.stringify(vc.component.editActivitiesBeautifulStaffInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#editActivitiesBeautifulStaffModel').modal('hide');
|
||||
vc.emit('activitiesBeautifulStaffManage','listActivitiesBeautifulStaff',{});
|
||||
return ;
|
||||
vc.emit('activitiesBeautifulStaffManage', 'listActivitiesBeautifulStaff', {});
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
},
|
||||
function(errInfo,error){
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.message(errInfo);
|
||||
});
|
||||
});
|
||||
},
|
||||
refreshEditActivitiesBeautifulStaffInfo:function(){
|
||||
vc.component.editActivitiesBeautifulStaffInfo= {
|
||||
beId:'',
|
||||
ruleId:'',
|
||||
staffId:'',
|
||||
activitiesNum:'',
|
||||
workContent:'',
|
||||
refreshEditActivitiesBeautifulStaffInfo: function () {
|
||||
vc.component.editActivitiesBeautifulStaffInfo = {
|
||||
beId: '',
|
||||
ruleId: '',
|
||||
staffId: '',
|
||||
activitiesNum: '',
|
||||
workContent: '',
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
editSendFile: function ($summernote, files) {
|
||||
console.log('上传图片', files);
|
||||
|
||||
var param = new FormData();
|
||||
param.append("uploadFile", files[0]);
|
||||
param.append('communityId', vc.getCurrentCommunity().communityId);
|
||||
|
||||
vc.http.upload(
|
||||
'addNoticeView',
|
||||
'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);
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
|
||||
},
|
||||
_initEditActivitiesBeautifulStaffInfo: function () {
|
||||
let $summernote = $('.editSummernote').summernote({
|
||||
lang: 'zh-CN',
|
||||
height: 300,
|
||||
placeholder: '必填,请输入工作简介',
|
||||
callbacks: {
|
||||
onImageUpload: function (files, editor, $editable) {
|
||||
vc.component.editSendFile($summernote, files);
|
||||
},
|
||||
onChange: function (contents, $editable) {
|
||||
vc.component.editActivitiesBeautifulStaffInfo.workContent = 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']],
|
||||
['help', ['help']]
|
||||
],
|
||||
});
|
||||
},
|
||||
_closeEditActivitiesBeauifulStaffInfo: function () {
|
||||
vc.emit('activitiesBeautifulStaffManage', 'listActivitiesBeautifulStaff', {});
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
})(window.vc, window.vc.component);
|
||||
|
||||
@ -62,23 +62,21 @@
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">ID</th>
|
||||
<!-- <th class="text-center">ID</th> -->
|
||||
<th class="text-center">评选编号</th>
|
||||
<th class="text-center">活动规则</th>
|
||||
<th class="text-center">员工</th>
|
||||
<th class="text-center">员工编号</th>
|
||||
<th class="text-center">创建时间</th>
|
||||
<th class="text-center">操作</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="activitiesBeautifulStaff in activitiesBeautifulStaffManageInfo.activitiesBeautifulStaffs">
|
||||
<td class="text-center">{{activitiesBeautifulStaff.beId}}</td>
|
||||
<!-- <td class="text-center">{{activitiesBeautifulStaff.beId}}</td> -->
|
||||
<td class="text-center">{{activitiesBeautifulStaff.activitiesNum}}</td>
|
||||
<td class="text-center">{{activitiesBeautifulStaff.ruleName}}</td>
|
||||
<td class="text-center">{{activitiesBeautifulStaff.staffName}}</td>
|
||||
<td class="text-center">{{activitiesBeautifulStaff.activitiesNum}}</td>
|
||||
<td class="text-center">{{activitiesBeautifulStaff.createTime}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
@ -112,7 +110,9 @@
|
||||
<div v-bind:class="{no_display:activitiesBeautifulStaffManageInfo.componentShow != 'addActivitiesBeautifulStaff'}">
|
||||
<vc:create path="property/addActivitiesBeautifulStaff" callBackListener="" callBackFunction=""></vc:create>
|
||||
</div>
|
||||
<vc:create path="property/editActivitiesBeautifulStaff"></vc:create>
|
||||
<div v-bind:class="{no_display:activitiesBeautifulStaffManageInfo.componentShow != 'editActivitiesBeautifulStaff'}">
|
||||
<vc:create path="property/editActivitiesBeautifulStaff"></vc:create>
|
||||
</div>
|
||||
<vc:create path="property/deleteActivitiesBeautifulStaff"></vc:create>
|
||||
|
||||
</div>
|
||||
@ -65,6 +65,7 @@
|
||||
vc.emit('addActivitiesBeautifulStaff', 'openAddActivitiesBeautifulStaffModal', {});
|
||||
},
|
||||
_openEditActivitiesBeautifulStaffModel: function (_activitiesBeautifulStaff) {
|
||||
$that.activitiesBeautifulStaffManageInfo.componentShow = 'editActivitiesBeautifulStaff';
|
||||
vc.emit('editActivitiesBeautifulStaff', 'openEditActivitiesBeautifulStaffModal', _activitiesBeautifulStaff);
|
||||
},
|
||||
_openDeleteActivitiesBeautifulStaffModel: function (_activitiesBeautifulStaff) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user