Selaa lähdekoodia

Merge branch '黑龙江艺术高中职' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 黑龙江艺术高中职

黑艺新账号
ndbs 1 vuosi sitten
vanhempi
commit
6b0cc60e1d
30 muutettua tiedostoa jossa 1567 lisäystä ja 369 poistoa
  1. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs
  2. +27
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampInfoController.cs
  3. +5
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.css
  4. +9
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.js
  5. +15
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/SignForm.cshtml
  6. +40
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/SignForm.js
  7. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/Form.js
  8. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/Index.js
  9. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.cshtml
  10. +25
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js
  11. +43
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml
  12. +21
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css
  13. +88
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js
  14. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml
  15. +210
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js
  16. +64
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml
  17. +88
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js
  18. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  19. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  20. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  21. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs
  22. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseNoLoginApi.cs
  23. +45
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewWorkFlowApi.cs
  24. +109
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StampPersonalApi.cs
  25. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config
  26. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageBLL.cs
  27. +20
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageEntity.cs
  28. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageIBLL.cs
  29. +20
    -8
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageService.cs
  30. +649
    -336
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue

+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs Näytä tiedosto

@@ -250,6 +250,13 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers
/// <returns></returns>
public ActionResult SignForm()
{
ViewBag.IsHaveStampRight = false;
var loginUserInfo = LoginUserInfo.Get();
if (loginUserInfo.Description.Contains("管理员") || loginUserInfo.roleIds.Split(',').Contains(Config.GetValue("StampRightRoleId")))
{
ViewBag.IsHaveStampRight = true;
}

return View();
}



+ 27
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampInfoController.cs Näytä tiedosto

@@ -47,6 +47,31 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers
{
return View();
}

/// <summary>
/// 管理页面【个人印章】
/// </summary>
/// <returns></returns>
public ActionResult IndexInPersonal()
{
return View("~/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml");
}
/// <summary>
/// 表单页面【个人印章】
/// </summary>
/// <returns></returns>
public ActionResult FormInPersonal()
{
return View("~/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml");
}
/// <summary>
/// 流程审批-个人印章【个人印章】
/// </summary>
/// <returns></returns>
public ActionResult StampDetailIndexInPersonal()
{
return View("~/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml");
}
#endregion

#region 获取数据
@@ -80,9 +105,9 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetList(string keyword)
public ActionResult GetList(string keyword, string userId, string category)
{
var data = lr_StampManageIBLL.GetList(keyword);
var data = lr_StampManageIBLL.GetList(keyword,userId,category);
return Success(data);
}



+ 5
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.css Näytä tiedosto

@@ -132,7 +132,7 @@

.form-list-tabs .nav-tabs > li {
white-space: nowrap;
display: inline-block !important;
/*display: inline-block !important;*/
float: initial;
}

@@ -236,13 +236,13 @@

.auditinfo-s {
position: absolute;
top: 0;
right: 200px;
height: 100px;
top: 25px;
right: 225px;
height: 50px;
}

.auditinfo-s img {
height: 100px;
height: 50px;
}

.auditinfo-sg {


+ 9
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/NWFContainerForm.js Näytä tiedosto

@@ -673,6 +673,13 @@ var bootstrap = function ($, learun) {
// }
//});

//需要填写审批意见时,验证审批意见的必填性
var des = $('#des').val();
if (btnData.isOpinion == '1' && !des) {
learun.alert.warning('请签署审批意见!');
return false;
}

top.flowAuditfn = function (signUrl, stamp) {
// 下个流程是否需要可以手动选择审核人
getNextUsers(btnData, nwflow.currentNode, '', nwflow.processId, nwflow.taskId, function (data) {
@@ -709,7 +716,7 @@ var bootstrap = function ($, learun) {
operationName: btnData.name,
processId: nwflow.processId,
taskId: nwflow.taskId,
des: $('#des').val(),
des: des,
auditors: JSON.stringify(auditers),
signUrl: signUrl,
stamp: stamp
@@ -736,7 +743,7 @@ var bootstrap = function ($, learun) {
operationName: btnData.name,
processId: nwflow.processId,
taskId: nwflow.taskId,
des: $('#des').val(),
des: des,
signUrl: signUrl,
stamp: stamp
};


+ 15
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/SignForm.cshtml Näytä tiedosto

@@ -4,18 +4,30 @@
}
<script src="~/Content/jquery/plugin/jSignature.min.js"></script>
<div class="lr-rblock" style="padding-bottom:40px;">
<div class="lr-rblock" style="padding:20px;">
<div class="lr-rblock" style="padding:20px;">
<div id="signature" style="border: 2px dotted black;background-color: lightgrey;"></div>
</div>
<div style="position:absolute;top:30px;right:30px;width:120px;height:120px;display:none;" id="stamp" >
<div style="position:absolute;top:30px;right:30px;width:120px;height:120px;display:none;" id="stamp">
<img style="width:120px;height:120px;" src="" />
</div>

<div class="lr-form-bottom-button" id="wizard-actions">
<a id="btn_stamp" class="btn btn-default">盖章</a>
<a id="btn_stampPersonal" class="btn btn-default">个人签章</a>
<a id="btn_stamp" class="btn btn-default">学校签章</a>
<a id="btn_reset" class="btn btn-danger">重置</a>
<a id="btn_finish" class="btn btn-success">确认</a>
</div>
</div>
@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/SignForm.js")

<script>
var IsHaveStampRight = "@ViewBag.IsHaveStampRight";
//console.log(IsHaveStampRight);
if (IsHaveStampRight.toLowerCase() == "true") {
$("#btn_stamp").attr("style", "display:inline-block;");
} else {
$("#btn_stamp").attr("style","display:none;");
}

</script>


+ 40
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/SignForm.js Näytä tiedosto

@@ -22,6 +22,7 @@ var bootstrap = function ($, learun) {
$('#stamp').hide();
stampUrl = '';
});
//学校公章
$('#btn_stamp').on('click', function () {
learun.layerForm({
id: 'StampDetailIndex',
@@ -39,6 +40,45 @@ var bootstrap = function ($, learun) {
}
});
});
//个人印章
$('#btn_stampPersonal').on('click', function () {
learun.layerForm({
id: 'StampDetailIndexInPersonal',
title: '印章列表',
url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/StampDetailIndexInPersonal',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(function (imgutl) {
$('#stamp').find('img').attr('src', top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=' + imgutl);
$('#stamp').show();
stampUrl = imgutl;
console.log(stampUrl);
});
}
});
});

function debounce(fn, delay) {
let time = null;
return function () {
if (time !== null) {
clearTimeout(time);
}
time = setTimeout(() => {
fn.call(this);
}, delay)
}
}

//$('#btn_finish').on('click', debounce(function () {
// console.log('123456')
// var datapair = $sigdiv.jsignature("getdata");
// top.flowauditfn(datapair,stampurl);
// learun.layerclose(window.name);
//},500))

function debounce(fn, delay) {
let time = null;


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/Form.js Näytä tiedosto

@@ -54,6 +54,8 @@ var bootstrap = function ($, learun) {
return false;
}

postData.F_Category = 1;

var f = document.getElementById('uploadFile').files[0];
//是否上传图片
if (!!f) {


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/Index.js Näytä tiedosto

@@ -198,6 +198,7 @@ var bootstrap = function ($, learun) {
param = param || {};
param.F_StampType = F_StampType;
param.F_EnabledMark = F_EnabledMark;
param.F_Category = 1;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
}


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.cshtml Näytä tiedosto

@@ -11,7 +11,7 @@
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</a>
</div>
<div class="lr-item" style="float:right;width:200px;margin-right:10px;">
<input id="F_Password" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入密码"/>
<input id="F_Password" type="password" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入密码"/>
</div>
</div>
<div id="datagird"></div>


+ 25
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampInfo/StampDetailIndex.js Näytä tiedosto

@@ -38,14 +38,14 @@ var bootstrap = function ($, learun) {
});
},
initData: function () {
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + '', function (data) {
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + '' +'&category=1', function (data) {
$('.lr-layout-wrap').lrSetFormData(data.data);
$('#datagird').jfGridSet('refreshdata', data);
});
},
search: function (param) {
param = param || {};
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + keyword, function (data) {
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + keyword+'&category=1', function (data) {
$('.lr-layout-wrap').lrSetFormData(data.data);
$('#datagird').jfGridSet('refreshdata', data);

@@ -54,14 +54,35 @@ var bootstrap = function ($, learun) {
};
acceptClick = function (callBack) {
var keyValue = $("#datagird").jfGridValue("F_StampId");
if (!keyValue) {
learun.alert.error("请选择印章!");
return false;
}
if (!$('.lr-item').lrValidform()) {
return false;
}
var postData = $('.lr-item').lrGetFormData();
var F_Password = $.md5(postData.F_Password);
learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) {
callBack(keyValue);

//learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) {
// callBack(keyValue);
//});

learun.loading(true, '正在提交数据');
learun.httpAsyncPost(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) {
learun.loading(false);
if (res.code == learun.httpCode.success) {
callBack(keyValue);
learun.alert.success(res.info);
top.layer.close(top.layer.index);
}
else {
learun.alert.error(res.info);
learun.httpErrorLog(res.info);
location.reload();
}
});

};
page.init();
}

+ 43
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml Näytä tiedosto

@@ -0,0 +1,43 @@

@{
ViewBag.Title = "个人印章操作";
Layout = "~/Views/Shared/_Form.cshtml";
}
@Html.AppendCssFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css")
<div class="lr-form-wrap" id="form">
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">印章名称<font face="宋体">*</font></div>
<input id="F_StampName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">印章分类<font face="宋体">*</font></div>
<div id="F_StampType" isvalid="yes" checkexpession="NotNull"></div>
</div>

<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">密码<font face="宋体">*</font></div>
<input id="F_Password" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">排序<font face="宋体">*</font></div>
<input id="F_Sort" type="text" class="form-control" isvalid="yes" checkexpession="Num" />
</div>
<div class="col-xs-12" style="padding-left:100px;">
<div class="lr-form-item-title">图片文件</div>
<div class="fileEx">
<input type="file" name="uploadFile" id="uploadFile">
</div>
<div class="text">
上传图片尺寸为200x200,大小不超过1M。
</div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">备注</div>
<textarea id="F_Description" type="text" class="form-control" style="height:140px;"></textarea>
</div>

</div>

@Html.AppendJsFile("/Views/LR_Content/script/lr-fileupload.js", "/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js")



+ 21
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css Näytä tiedosto

@@ -0,0 +1,21 @@
.fileEx {
width: 100%;
height: 120px;
position: relative;
overflow: hidden;
}

.fileEx input {
position: absolute;
font-size: 120px;
right: 0;
top: 0;
opacity: 0;
cursor: pointer !important;
}

.fileEx img {
width: 120px;
height: 120px;
cursor: pointer;
}

+ 88
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js Näytä tiedosto

@@ -0,0 +1,88 @@
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2018 上海力软信息技术有限公司
* 创建人:力软-前端开发组
* 日 期:2022.12.05
* 描 述:个人印章管理
*/

var acceptClick;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
var selectedRow = learun.frameTab.currentIframe().selectedRow;

function uploadImg() {
var f = document.getElementById("uploadFile").files[0];//获取文件
var src = window.URL.createObjectURL(f);
document.getElementById('uploadPreview').src = src;
}
var page = {
init: function () {
page.bind();
page.initData();
},
bind: function () {
// 印章分类
$('#F_StampType').lrDataItemSelect({ code: 'StampType' });
//图片显示
$('#uploadFile').on('change', uploadImg);
$('.fileEx').prepend('<img id="uploadPreview" src="' + top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=' + keyValue + '" >');
},
initData: function () {
if (!!selectedRow) {
selectedRow.F_Password = '*****';
$('#form').lrSetFormData(selectedRow);
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('#form').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData(keyValue);
if (postData.F_Password != '*****' || !keyValue) {
postData.F_Password = $.md5(postData.F_Password);
}
else {
delete postData.F_Password;
}
if (!keyValue && !postData.uploadFile) {
learun.alert.error("请选择图片");
return false;
}

postData.F_Category = 2;

var f = document.getElementById('uploadFile').files[0];
//是否上传图片
if (!!f) {
learun.loading(true, '正在保存...');
$.ajaxFileUpload({
data: postData,
url: top.$.rootUrl + "/LR_NewWorkFlow/StampInfo/UploadFile?keyValue=" + keyValue,
secureuri: false,
fileElementId: 'uploadFile',
dataType: 'json',
success: function (data) {
if (!!callBack) {
callBack();
}
learun.loading(false);
learun.layerClose(window.name);
}
});
}
else {
$.lrSaveForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
}
};
page.init();
}

+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml Näytä tiedosto

@@ -0,0 +1,61 @@

@{
ViewBag.Title = "个人印章管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout lr-layout-left-center" id="lr_layout">
<div class="lr-layout-left">
<div class="lr-layout-wrap">
<div class="lr-layout-title lrlg ">印章分类信息</div>
<div id="lr_left_tree" class="lr-layout-body"></div>
</div>
</div>
<div class="lr-layout-center">
<div class="lr-layout-wrap">
<div class="lr-layout-title">
<span class="lrlg">印章管理</span> - <span id="titleinfo" class="lrlg">未选择分类</span>
</div>
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item" style="margin-top:-4px;margin-right:8px;">
<div class="radio">
<label><input name="isEnabled" id="isEnable" type="radio" value="1" />启用</label>
<label><input name="isEnabled" id="isDisable" type="radio" value="0" />禁用</label>
</div>
</div>
<div class="lr-layout-tool-item">
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入印章名称" />
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span class="lrlg">查询</span></a>
</div>
</div>
<div class="lr-layout-tool-right">
<div class="btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class="btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;<span class="lrlg">新增</span></a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;<span class="lrlg">编辑</span></a>
<a id="lr_more" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-reorder"></i>&nbsp;<span class="lrlg">更多</span><span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right">
<li id="lr_delete"><a><i></i>&nbsp;<span class="lrlg">删除</span></a></li>
<li id="lr_enable"><a><i></i>&nbsp;<span class="lrlg">启用</span></a></li>
<li id="lr_disabled"><a><i></i>&nbsp;<span class="lrlg">停用</span></a></li>
</ul>

</div>
<div class="btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_category" class="btn btn-default"><i class="fa fa-tags"></i>&nbsp;<span class="lrlg">分类管理</span></a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js")


+ 210
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js Näytä tiedosto

@@ -0,0 +1,210 @@
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2018 上海力软信息技术有限公司
* 创建人:
* 日 期:2022.12.05
* 描 述:个人印章管理
*/
var selectedRow;
var refreshGirdData;
var F_StampType;
var F_StampName;
var F_EnabledMark;
var acceptClick;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGrid();
page.bind();
},
bind: function () {
// 左侧数据加载
$('#lr_left_tree').lrtree({
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailTree',
param: { itemCode: 'StampType' },
nodeClick: function (item) {
F_StampType = item.value;
F_StampName = null;//将文本框数据设置为null,如果不设置,那么不能按照左侧分类查询
F_EnabledMark = null;//将文本框数据设置为null,如果不设置,那么不能按照左侧分类查询
$('#titleinfo').text(item.text);
page.search();
}
});
//查询
$('#btn_Search').on('click', function () {
var keyword = $('#txt_Keyword').val();
F_StampType = null;
page.search({ F_StampName: keyword });
});

$('[name="isEnabled"]').on('click', function () {
var value = $(this).val(); //状态查询
if (value == 1) {
F_EnabledMark = value;
page.search();
}
else {
F_EnabledMark = value;
page.search();
}
});
//刷新
$("#lr_refresh").on('click', function () {
location.reload();
});
//新增
$("#lr_add").on('click', function () {
selectedRow = null;
learun.layerForm({
id: 'form',
title: '添加印章',
url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/FormInPersonal',
width: 700,
height: 500,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
//编辑
$("#lr_edit").on("click", function () {
selectedRow = $("#gridtable").jfGridGet("rowdata");//获取选中的当前行数据
var keyValue = $("#gridtable").jfGridValue("F_StampId");//获取当前选中的主键值
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'Form',
title: '编辑印章',
url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/FormInPersonal?keyValue=' + keyValue,
width: 750,
height: 500,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
//删除
$("#lr_delete").on("click", function () {
var keyValue = $('#gridtable').jfGridValue('F_StampId');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
// 启用
$('#lr_enable').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('F_StampId');
var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark');
if (learun.checkrow(keyValue)) {
if (enabledMark != 1) {
learun.layerConfirm('是否确认启用该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/UpDateSate', { keyValue: keyValue, state: 1 }, function () {
refreshGirdData();
});
}
});
}
else {
learun.alert.warning('该项已启用!');
}
}
});
// 禁用
$('#lr_disabled').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('F_StampId');
var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark');

if (learun.checkrow(keyValue)) {
if (enabledMark == 1) {
learun.layerConfirm('是否确认禁用该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/UpDateSate', { keyValue: keyValue, state: 0 }, function () {
refreshGirdData();
});
}
});
}
else {
learun.alert.warning('该项已禁用!');
}
}
});
/*分类管理*/
$('#lr_category').on('click', function () {
learun.layerForm({
id: 'ClassifyIndex',
title: '分类管理',
url: top.$.rootUrl + '/LR_SystemModule/DataItem/DetailIndex?itemCode=StampType',
width: 800,
height: 500,
maxmin: true,
btn: null,
end: function () {
learun.clientdata.update('dataItem');
location.reload();
}
});
});
},
initGrid: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetPageList',
headData: [
{ label: '印章名称', name: 'F_StampName', width: 150, align: "center" },
{
label: '印章分类', name: 'F_StampType', width: 100, align: "center",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'StampType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: '图片', name: 'F_ImgFile', width: 110, align: "center",
formatter: function (value, row, op, $cell) {
return '<img src="' + top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=' + row.F_StampId + '" style="position: absolute;height:100px;width:100px;top:5px;left:5px;" >';
}
},
{
label: '状态', name: 'F_EnabledMark', width: 60, align: "center", formatter: function (value, row, op, $cell) {
if (value == 1) {
return '<span class=\"label label-success\" style=\"cursor: pointer;\">启用</span>';
} else if (value == 0) {
return '<span class=\"label label-default\" style=\"cursor: pointer;\">禁用</span>';
}
}
},
{ label: '备注', name: 'F_Description', width: 200, align: "left" }
],
mainId: 'F_StampId',
isPage: true,
rowHeight: 110,
sidx: 'F_EnabledMark Desc,F_Sort ASC'
});
page.search();
},
search: function (param) {
param = param || {};
param.F_StampType = F_StampType;
param.F_EnabledMark = F_EnabledMark;
param.F_Category = 2;
param.F_CreateUserId = learun.clientdata.get(['userinfo']).userId;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
}
refreshGirdData = function () {
page.search();
};
page.init();
}

+ 64
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml Näytä tiedosto

@@ -0,0 +1,64 @@
@{
ViewBag.Title = "个人印章管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-layout">
<div class="lr-form-layout-top">
<div class="lr-item">
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width:240px;" />
</div>
<div class="lr-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</a>
</div>
<div class="lr-item" style="float:right;width:200px;margin-right:10px;">
<input id="F_Password" type="password" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入密码"/>
</div>
</div>
<div id="datagird"></div>
</div>

@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js")

<style>
.lr-form-layout {
padding: 44px 0 0 0;
}

.lr-form-layout-top {
position: absolute;
top: 0;
left: 0;
border-bottom: 1px solid #ddd;
height: 44px;
width: 100%;
padding-left: 3px;
z-index: 4;
}

.lr-item {
position: relative;
float: left;
padding-top: 8px;
padding-left: 5px;
line-height: 28px;
}

.lr-item .btn {
position: relative;
display: inline-block;
height: 28px;
margin-bottom: 1px;
line-height: 14px;
}

.lr-item .lr-select {
width: 170px;
}

.lr-item .lr-field-error-info {
top: 9px;
height: 26px;
}

</style>


+ 88
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js Näytä tiedosto

@@ -0,0 +1,88 @@
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2018 上海力软信息技术有限公司
* 创建人:
* 日 期:2022.12.05
* 描 述:个人印章管理
*/
var keyword;
var acceptClick;
var path = '';
var bootstrap = function ($, learun) {
"use strict";
// 保存数据
var page = {
init: function () {
page.bind();
page.initData();
},
bind: function () {
// 订单产品信息
$('#datagird').jfGrid({
headData: [
{ label: '名称', name: 'F_StampName', width: 150, align: "center" },
{
label: '印章', name: 'F_ImgFile', width: 110, align: "left",
formatter: function (value, row, op, $cell) {
return '<img src="' + top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetImg?keyValue=' + row.F_StampId + '" style="position: absolute;height:100px;width:100px;top:5px;left:5px;" >';
}
}
],
mainId: 'F_StampId',
rowHeight: 110,
});
//查询
$('#btn_Search').on('click', function () {
keyword = $('#txt_Keyword').val();
page.search({ keyword: keyword });
});
},
initData: function () {
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + '' + '&category=2&userId=' + learun.clientdata.get(['userinfo']).userId, function (data) {
$('.lr-layout-wrap').lrSetFormData(data.data);
$('#datagird').jfGridSet('refreshdata', data);
});
},
search: function (param) {
param = param || {};
$.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/GetList?keyword=' + keyword + '&category=2&userId=' + learun.clientdata.get(['userinfo']).userId, function (data) {
$('.lr-layout-wrap').lrSetFormData(data.data);
$('#datagird').jfGridSet('refreshdata', data);

});
}
};
acceptClick = function (callBack) {
var keyValue = $("#datagird").jfGridValue("F_StampId");
if (!keyValue) {
learun.alert.error("请选择印章!");
return false;
}
if (!$('.lr-item').lrValidform()) {
return false;
}
var postData = $('.lr-item').lrGetFormData();
var F_Password = $.md5(postData.F_Password);
//learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) {
// callBack(keyValue);
//});

learun.loading(true, '正在提交数据');
learun.httpAsyncPost(top.$.rootUrl + '/LR_NewWorkFlow/StampInfo/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) {
learun.loading(false);
if (res.code == learun.httpCode.success) {
callBack(keyValue);
learun.alert.success(res.info);
top.layer.close(top.layer.index);
}
else {
learun.alert.error(res.info);
learun.httpErrorLog(res.info);
location.reload();
}
});

};
page.init();
}

+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Näytä tiedosto

@@ -1650,6 +1650,10 @@
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Form.js" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Index.js" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.js" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Form.css" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Form.js" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Index.js" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\StampDetailIndex.js" />
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\Form.js" />
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormClaim.js" />
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormView.js" />
@@ -8289,6 +8293,9 @@
<Content Include="Areas\PersonnelManagement\Views\MeetingMinutes\Index.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingNotice\Form.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingNotice\Index.cshtml" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Form.cshtml" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Index.cshtml" />
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\StampDetailIndex.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config Näytä tiedosto

@@ -168,6 +168,8 @@
<add key="QJUrl" value="www.qj.com"/>
<!--系主任角色Id-->
<add key="DeptDirectorRoleId" value="9310c5f3-1a0a-4f23-9452-3e5a15b3b722" />
<!--学校签章使用权角色Id 流程审批时是否有使用学校签章的权限;-->
<add key="StampRightRoleId" value="cf0dc3da-3706-41ec-9032-02d1f4650d3b"/>
<!-- 登录次数限制:登录连续错误要禁止登录 -->
<add key="ForbidLoginNum" value="5"/>
<!-- 禁止登录时间(分钟) -->


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Näytä tiedosto

@@ -227,6 +227,7 @@
<Compile Include="Modules\RepairReport\RepairReportTeacherApi.cs" />
<Compile Include="Modules\RepairReport\RepairReportStudentApi.cs" />
<Compile Include="Modules\SSOApi.cs" />
<Compile Include="Modules\StampPersonalApi.cs" />
<Compile Include="Modules\StuEnrollOfficialApi.cs" />
<Compile Include="Modules\AnnexesNoLoginApi.cs" />
<Compile Include="Modules\AssetManagementSystem\Ass_AssetsInfoItemApi.cs" />


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseApi.cs Näytä tiedosto

@@ -191,7 +191,7 @@ namespace Learun.Application.WebApi
ReqParameter req = this.Bind<ReqParameter>();
loginMark = req.loginMark;
token = req.token;
if (path == "/learun/adms/user/login"|| path == "/learun/adms/user/loginbyIdCard" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img"||path== "/learun/adms/user/imgfordc"||path== "/learun/adms/timetable/timeTableData"||path== "/quanjiang/sso/authorize")
if (path == "/learun/adms/user/login" || path == "/learun/adms/user/loginbyIdCard" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img" || path == "/learun/adms/user/imgfordc" || path == "/learun/adms/timetable/timeTableData" || path == "/quanjiang/sso/authorize" || path == "/learun/adms/StampPersonal/img")
{// 登录接口,默认页面接口不做权限验证处理
return null;
}


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseNoLoginApi.cs Näytä tiedosto

@@ -161,7 +161,7 @@ namespace Learun.Application.WebApi
ReqParameter req = this.Bind<ReqParameter>();
loginMark = req.loginMark;
token = req.token;
if (path == "/learun/adms/user/login" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img")
if (path == "/learun/adms/user/login" || path == "/" || path == "/bgimg" || path == "/learun/adms/user/img" || path == "/learun/adms/desktop/img" || path == "/learun/adms/StampPersonal/img")
{// 登录接口,默认页面接口不做权限验证处理
return null;
}


+ 45
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewWorkFlowApi.cs Näytä tiedosto

@@ -46,6 +46,9 @@ namespace Learun.Application.WebApi.Modules
Post["/revoke"] = RevokeFlow;

Post["/refer"] = ReferFlow;
Post["/instance"] = SaveInstanceForms;
Post["/auditors"] = SaveAuditors;

}
private NWFSchemeIBLL nWFSchemeIBLL = new NWFSchemeBLL();
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
@@ -296,8 +299,8 @@ namespace Learun.Application.WebApi.Modules
{
formSchemeIBLL.SaveInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue, item.formData);
}
//TODO:移动端传参signUrl???
nWFProcessIBLL.AuditFlow(parameter.operationCode, parameter.operationName, parameter.processId, parameter.taskId, parameter.des, parameter.auditors, "", parameter.signUrl, userInfo);
//移动端传参signUrl,stamp,
nWFProcessIBLL.AuditFlow(parameter.operationCode, parameter.operationName, parameter.processId, parameter.taskId, parameter.des, parameter.auditors, parameter.stamp, parameter.signUrl, userInfo);
return Success("审批成功");
}

@@ -379,6 +382,41 @@ namespace Learun.Application.WebApi.Modules
nWFProcessIBLL.ReferFlow(parameter.processId, parameter.taskId, userInfo);
return Success("确认成功");
}
/// <summary>
/// app保存实例
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response SaveInstanceForms(dynamic _)
{
List<FormParam> param = this.GetReqData<List<FormParam>>();

foreach (var item in param)
{
formSchemeIBLL.SaveInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue, item.formData);
}
return Success("保存成功!");
}
/// <summary>
/// app保存审核人
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response SaveAuditors(dynamic _)
{
var param = this.GetReqData<flowParam>();
UserInfo userInfo = LoginUserInfo.Get();
try
{
nWFProcessIBLL.AuditFlow(param.operationCode, param.operationName, param.processId, param.taskId, param.des, param.auditors, param.stamp, param.signUrl, userInfo);
return Success("流程审批成功");
}
catch (System.Exception ex)
{

return Fail(ex.Message);
}
}

private class flowParam
{
@@ -443,6 +481,11 @@ namespace Learun.Application.WebApi.Modules
/// 签字图片信息
/// </summary>
public string signUrl { get; set; }

/// <summary>
/// 签章信息
/// </summary>
public string stamp { get; set; }
}

/// <summary>


+ 109
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StampPersonalApi.cs Näytä tiedosto

@@ -0,0 +1,109 @@
using Learun.Application.AppMagager;
using Learun.Util;
using Nancy;
using System.Collections.Generic;
using System.Linq;
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.LR_Desktop;
using System.Text;
using System.Data;
using Learun.Application.WorkFlow;
using Learun.Application.OA.LR_StampManage;


namespace Learun.Application.WebApi.Modules
{

public class StampPersonalApi : BaseApi
{

public StampPersonalApi()
: base("/learun/adms/StampPersonal")
{
Get["/list"] = GetList;
Get["/schoollist"] = GetSchoolList;
Get["/img"] = GetImg;
Post["/equalPassword"] = EqualPassword;
Get["/ishaveright"] = IsHaveStampRight;
}
private LR_StampManageIBLL lr_StampManageIBLL = new LR_StampManageBLL();

/// <summary>
/// 个人签章
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetList(dynamic _)
{
SPParam param = this.GetReqData<SPParam>();
var data = lr_StampManageIBLL.GetList(param.keyword, userInfo.userId, "2");
return Success(data);
}
/// <summary>
/// 学校签章
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetSchoolList(dynamic _)
{
SPParam param = this.GetReqData<SPParam>();
var data = lr_StampManageIBLL.GetList(param.keyword, null, "1");
return Success(data);
}
/// <summary>
/// 获取签章图片
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetImg(dynamic _)
{
string param = this.GetReqData();
lr_StampManageIBLL.GetImg(param);
return Success("");
}
/// <summary>
/// 验证签章密码
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response EqualPassword(dynamic _)
{
var msg = "";
SPParam param = this.GetReqData<SPParam>();
var data = lr_StampManageIBLL.EqualPassword(param.F_StampId, param.F_Password);
if (data)
{
msg = "密码验证成功!";
}
else
{
msg = "密码不正确!";
}
return Success(new { result = data, msg = msg });
}
/// <summary>
/// 判断登录用户是否有“学校签章”的使用权限
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response IsHaveStampRight(dynamic _)
{
var result = false;
if (userInfo.Description.Contains("管理员") || userInfo.roleIds.Split(',').Contains(Config.GetValue("StampRightRoleId")))
{
result = true;
}

return Success(new { result = result });
}

}

public class SPParam
{
public string keyword { get; set; }
public string F_StampId { get; set; }
public string F_Password { get; set; }
}

}

+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config Näytä tiedosto

@@ -111,6 +111,8 @@
<add key="OnlineElectiveLessonApplyMax" value="2" />
<!--系主任角色Id-->
<add key="DeptDirectorRoleId" value="9310c5f3-1a0a-4f23-9452-3e5a15b3b722" />
<!--学校签章使用权角色Id 流程审批时是否有使用学校签章的权限;-->
<add key="StampRightRoleId" value="cf0dc3da-3706-41ec-9032-02d1f4650d3b"/>
<!--最早上课打卡时间(分钟)-->
<add key="StuAttendanceEarliestMinute" value="15" />

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageBLL.cs Näytä tiedosto

@@ -26,11 +26,11 @@ namespace Learun.Application.OA.LR_StampManage
/// </summary>
/// <param name="keyWord">查询的关键字</param>
/// <returns></returns>
public IEnumerable<LR_StampManageEntity> GetList(string keyWord)
public IEnumerable<LR_StampManageEntity> GetList(string keyWord, string userId, string category)
{
try
{
return lr_StampManageService.GetList(keyWord);
return lr_StampManageService.GetList(keyWord,userId,category);

}
catch (Exception ex)


+ 20
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageEntity.cs Näytä tiedosto

@@ -55,6 +55,21 @@ namespace Learun.Application.OA.LR_StampManage
/// </summary>
[Column("F_ENABLEDMARK")]
public int? F_EnabledMark { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("F_CREATEUSERID")]
public string F_CreateUserId { get; set; }
/// <summary>
/// 时间
/// </summary>
[Column("F_CREATETIME")]
public DateTime? F_CreateTime { get; set; }
/// <summary>
/// 印章分类:1学校公章2个人印章
/// </summary>
[Column("F_CATEGORY")]
public int? F_Category { get; set; }

#region 扩展方法

@@ -65,7 +80,9 @@ namespace Learun.Application.OA.LR_StampManage
public void Modify(string keyValue)
{
this.F_StampId = keyValue;
this.F_CreateUserId = LoginUserInfo.Get().userId; //创建人
this.F_CreateTime = DateTime.Now;

}
/// <summary>
/// 新增调用
@@ -74,6 +91,8 @@ namespace Learun.Application.OA.LR_StampManage
{
this.F_StampId = Guid.NewGuid().ToString(); //产生印章编号
this.F_EnabledMark = 1;//默认状态为启用
this.F_CreateUserId = LoginUserInfo.Get().userId; //创建人
this.F_CreateTime = DateTime.Now;
}
#endregion



+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageIBLL.cs Näytä tiedosto

@@ -18,7 +18,7 @@ namespace Learun.Application.OA.LR_StampManage
/// </summary>
/// <param name="keyWord"></param>
/// <returns></returns>
IEnumerable<LR_StampManageEntity> GetList(string keyWord);
IEnumerable<LR_StampManageEntity> GetList(string keyWord, string userId, string category);
/// <summary>
/// 获取列表分页数据
/// <param name="pagination">分页参数</param>


+ 20
- 8
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LR_StampManage/LR_StampManageService.cs Näytä tiedosto

@@ -23,13 +23,7 @@ namespace Learun.Application.OA.LR_StampManage
{
//sql字段
fieldSql = @"
F_StampId,
F_StampName,
F_Description,
F_StampType,
F_ImgFile,
F_Sort,
F_EnabledMark
*
";
}
#endregion
@@ -40,7 +34,7 @@ namespace Learun.Application.OA.LR_StampManage
/// </summary>
/// <param name="keyWord">名称/状态</param>
/// <returns></returns>
public IEnumerable<LR_StampManageEntity> GetList(string keyWord)
public IEnumerable<LR_StampManageEntity> GetList(string keyWord, string userId,string category)
{
try
{
@@ -52,6 +46,14 @@ namespace Learun.Application.OA.LR_StampManage
if (!string.IsNullOrEmpty(keyWord)) {// cbb 如果没有查询条件则不需要输入
Sql.AppendFormat(" and s.F_StampName LIKE '%{0}%'", keyWord);
}
if (!string.IsNullOrEmpty(userId))
{
Sql.AppendFormat(" and s.F_CreateUserId = '{0}'", userId);
}
if (!string.IsNullOrEmpty(category))
{
Sql.AppendFormat(" and s.F_Category = {0}", Convert.ToInt32(category));
}

Sql.Append(" Order by F_Sort");

@@ -102,6 +104,16 @@ namespace Learun.Application.OA.LR_StampManage
dp.Add("F_StampType", queryParam["F_StampType"].ToString(), DbType.String);
strSql.Append(" AND s.F_StampType = @F_StampType");
}
if (!queryParam["F_CreateUserId"].IsEmpty())
{
dp.Add("F_CreateUserId", queryParam["F_CreateUserId"].ToString(), DbType.String);
strSql.Append(" AND s.F_CreateUserId = @F_CreateUserId");
}
if (!queryParam["F_Category"].IsEmpty())
{
dp.Add("F_Category", queryParam["F_Category"].ToString(), DbType.String);
strSql.Append(" AND s.F_Category = @F_Category");
}
}
return this.BaseRepository().FindList<LR_StampManageEntity>(strSql.ToString(), dp, pagination);
}


+ 649
- 336
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue Näytä tiedosto

@@ -1,344 +1,657 @@
<template>
<view>
<l-label title="流程名称:">{{ taskParam.taskName }}</l-label>
<l-label title="当前操作:">{{ typeText }}{{ type === 'sign' ? '' : ` [${taskParam.name}]` }}</l-label>
<l-organize-picker
v-if="type === 'sign'"
v-model="staff"
title="加签人员"
placeholder="请选择加签人员"
type="user"
required
arrow
/>

<!-- 手写签名 canvas 区 -->
<template v-if="Number(taskParam.isSign) === 1">
<view class="cu-form-group"><view class="title">手写签名:</view></view>
<view class="sign-area bg-white">
<canvas
v-if="canvas"
@touchmove="signMove"
@touchstart="signStart($event)"
@touchend="signEnd"
@touchcancel="signEnd"
disable-scroll="true"
canvas-id="sign-canvas"
id="sign-canvas"
class="sign-canvas"
></canvas>
</view>
<view class="sign-action padding-bottom text-right">
<l-button @click="clearSign" color="red" style="margin-right: 15px;">清空签名板</l-button>
</view>
</template>

<l-textarea v-model="remark" :placeholder="`输入${typeText}意见`" title="审核意见:" />
<!-- 弹层 -->
<l-modal v-model="modal" @close="reviewer = ''" title="指派审核人">
<l-checkbox-picker @input="(e)=>{reviewer = e}" :value="reviewer" :readonly="false" :range="reviewerList"
required title="审核人" />
<l-button @click="userAssign" color="blue" class="block" block>确定指派</l-button>
<l-button @click="()=>{modal = false;reviewer = ''}" line="blue" class="block margin-top-sm" block>取消</l-button>
</l-modal>

<view class="padding margin-top bg-white">
<l-button @click="submit" class="block" size="lg" color="green" block>提交流程{{ typeText }}</l-button>
</view>
</view>
<view>
<view>
<view class="cu-bar bg-white cu-title solid-bottom">
<view class="action" style="vertical-align: middle;">
<text class="margin-right-xs text-blue cuIcon-title">
<span></span>
</text>
<text class="text-xl">
<span>{{ taskParam.taskName }}</span>
</text>
</view>
</view>
</view>
<l-label title="流程名称:">{{ taskParam.taskName }}</l-label>
<l-label title="当前操作:">{{ typeText }}{{ type === 'sign' ? '' : ` [${taskParam.name}]` }}</l-label>
<l-organize-picker v-if="type === 'sign'" v-model="staff" title="加签人员" placeholder="请选择加签人员" type="user"
required arrow />

<!-- 手写签名 canvas 区 -->
<template v-if="Number(taskParam.isSign) === 1">
<view class="cu-form-group">
<view class="title">手写签名:</view>
</view>
<view class="sign-area bg-white">
<canvas v-if="canvas" @touchmove="signMove" @touchstart="signStart($event)" @touchend="signEnd"
@touchcancel="signEnd" disable-scroll="true" canvas-id="sign-canvas" id="sign-canvas"
class="sign-canvas"></canvas>
</view>
<view class="sign-action padding-bottom text-right">
<l-button @click="clearSign" color="red" style="margin-right: 15px;">清空签名板</l-button>
</view>
<view class="cu-form-group">
<view class="title">签章:</view>
</view>
<view v-if="" class="Signwrap">
<image style="width: 50px;height: 50px;margin: 15px;" :src="Signimg"></image>
</view>
<view class="sign-action padding-bottom text-right">
<!-- <l-button @click="Signature" color="" style="color: #FFFFFF; background: #0081ff; margin-right: 15px;">签章</l-button> -->
<picker class="cu-btn df"
style="background-color: #0081ff;color: #ffffff;margin-right: 15px;border-radius: 5px;"
@change="Signature" :range="Signaitem" range-key="F_StampName">个人签章</picker>
<picker v-if="ComStatus" class="cu-btn df"
style="background-color: #fe955c;color: #ffffff;margin-right: 15px;border-radius: 5px;"
@change="Commonture" :range="Commonseal" range-key="F_StampName">学校签章</picker>
<l-button @click="clearcom" color="red" style="margin-right: 15px;">清空签章</l-button>
</view>
</template>
<l-textarea v-model="remark" :placeholder="`输入${typeText}意见`" title="审核意见:" required />

<!-- 弹层 -->
<l-modal v-model="modal" @close="reviewer = ''" title="指派审核人">
<l-checkbox-picker @input="(e)=>{reviewer = e}" :value="reviewer" :readonly="false" :range="reviewerList"
required title="审核人" />
<l-button @click="userAssign" :disabled="userAssignDisable" color="blue" class="block" block>确定指派</l-button>
<l-button @click="()=>{modal = false;reviewer = ''}" line="blue" class="block margin-top-sm"
block>取消</l-button>
</l-modal>

<view class="padding margin-top bg-white">
<l-button @click="submit" :disabled="submitDisable" class="block" size="lg" color="green"
block>提交流程{{ typeText }}</l-button>
</view>

<view class="pswd-uni-mask" v-if="passshow">
<view class="pswd-uni-modal">
<view class="pswd-uni-modal__hd">
<view class="pswd-strong">输入密码</view>
</view>
<view class="pswd-uni-modal__hd" style="margin-bottom: 1em;">
<input class="pswdinp" type="password" v-model="password" placeholder="密码">
</view>

<view class="pswd-uni-modal__ft">
<view class="pswd-uni-modal__btn" style="color:rgb(57, 181, 74)" @click="cancelpswd">
取消
</view>
<view class="pswd-uni-modal__btn pswd__btn_primary" style="color: rgb(245, 88, 80);"
@click="confirmpswd">
确认
</view>
</view>
</view>
</view>



</view>
</template>

<script>
import get from 'lodash/get'

let context = null
let touchs = []

export default {
data() {
return {
type: 'sign',
typeText: '',

staff: '',
remark: '',
taskParam: {},
canvas: true,
modal: false,
reviewer: [],
reviewerList: [],
reviewerListId:'',
submitPostData:null,
}
},

async onLoad() {
await this.init()
},

methods: {
// 页面初始化
async init() {
this.taskParam = this.GET_PARAM()
this.type = this.taskParam.type
this.typeText = this.taskParam.type === 'sign' ? '加签' : '审核'

if (Number(this.taskParam.isSign) === 1) {
this.canvasInit()
}
},

// 初始化签名区 canvas
canvasInit() {
this.canvas = true
context = uni.createCanvasContext('sign-canvas')
context.setStrokeStyle('#000')
context.setLineWidth(5)
context.setLineCap('round')
context.setLineJoin('round')
touchs = []
},
// 指派审核人
async userAssign() {
if(!this.reviewer.length){
this.modal = false
this.TOAST('请选择审核人')
return
import get from 'lodash/get'

let context = null
let touchs = []

export default {
data() {
return {
type: 'sign',
typeText: '',

staff: '',
remark: '',
taskParam: {},
canvas: true,

modal: false,
reviewer: [],
reviewerList: [],
reviewerListId: '',
submitPostData: null,

// 列表与分页信息
page: 1,
total: 2,

// 选择个人签章
Signaitem: [],
// 公章
Commonseal: [],
// 是否显示公章
ComStatus: false,

pitchon: '',
Signimg: '',
// 填写密码
passshow: false,
password: '',
PitchonSign: '',
canvasW: '',
canvasH: '',
signshow: false,
ConfirmSign: '',

submitDisable: false,
userAssignDisable: false,
}
},

async onLoad() {
await this.init()
// this.Signimg = this.API + `/learun/adms/user/img?data=${'System'}`
// this.Signimg = this.API + `/learun/adms/StampPersonal/img?data=${'47201f98-7611-4052-b271-bb99bd7b1d3c'}`
},

methods: {
// 页面初始化
async init() {
this.taskParam = this.GET_PARAM()
this.type = this.taskParam.type
this.typeText = this.taskParam.type === 'sign' ? '加签' : '审核'
await this.getComstatus()
await this.getSigna()
await this.getCommonseal()
if (Number(this.taskParam.isSign) === 1) {
this.canvasInit()

}
},

// 获取个人签章
getSigna() {
return this.HTTP_GET("learun/adms/StampPersonal/list", {}, "加载数据时出错").then(async res => {
if (res) {
this.Signaitem = res
}
})
},

// 获取是否展示公章
getComstatus() {
return this.HTTP_GET("learun/adms/StampPersonal/ishaveright", {}, "加载数据时出错").then(async res => {
if (res) {
this.ComStatus = res.result
}
})
},

// 获取学校签章
getCommonseal() {
return this.HTTP_GET("learun/adms/StampPersonal/schoollist", {}, "加载数据时出错").then(async res => {
if (res) {
this.Commonseal = res
}
})
},
// 初始化签名区 canvas
canvasInit() {
this.canvas = true
context = uni.createCanvasContext('sign-canvas')
context.setStrokeStyle('#000')
context.setLineWidth(5)
context.setLineCap('round')
context.setLineJoin('round')
touchs = []
},

// 点击个人签章
Signature(e) {
let signindex = e.detail.value;
this.pitchon = this.Signaitem[signindex]
this.PitchonSign = this.Signaitem[signindex].F_StampId
this.passshow = true
},
// 选择学校签章
Commonture(e) {
let signindex = e.detail.value;
this.pitchon = this.Commonseal[signindex]
this.PitchonSign = this.Commonseal[signindex].F_StampId
this.passshow = true
},
// 取消
cancelpswd() {
this.passshow = false
this.password = ''
},
// 确认
confirmpswd() {
let _this = this
this.HTTP_POST('learun/adms/StampPersonal/equalPassword', {
F_StampId: this.pitchon.F_StampId,
F_Password: this.MD5(this.password)
}).then(async res => {
if (res.result) {
_this.ConfirmSign = _this.PitchonSign
let imgurl = _this.API +
`/learun/adms/StampPersonal/img?data=${_this.pitchon.F_StampId}`
_this.Signimg = imgurl
_this.signshow = true
_this.passshow = false
_this.password = ''
_this.pitchon = ''
} else {
this.TOAST(`${res.msg}`, 'error')
}
})


},
// 绘制签章图片到canvas
SignaApply(goodsImg) {
let _this = this
uni.getImageInfo({
src: goodsImg,
success: function(image) {
_this.canvasW = image.width / 5; //因为需要所以缩放了8倍
_this.canvasH = image.height / 5;
}
})

setTimeout(() => {
context.drawImage(goodsImg, 250, 150, 100, 100)
context.draw(true, (res) => {

})
})
},
// 指派审核人
async userAssign() {
if (!this.reviewer.length) {
this.modal = false
this.TOAST('请选择审核人')
return
}
// let formdata = new FormData()
// formdata.append("data",this.taskParam.formreq)
this.userAssignDisable = true
uni.showLoading({
title: '提交中...'
});
const res = await this.HTTP_POST('learun/adms/newwf/instance', this.taskParam.formreq, `指派审核人时发生错误`)
if (!res) {
this.userAssignDisable = false
uni.hideLoading();
return
}

this.submitPostData.auditors = JSON.stringify({
[this.reviewerListId]: this.reviewer.toString()
})
delete this.submitPostData.formreq
// this.submitPostData.auditors[this.reviewerListId] = this.reviewer
const success = await this.HTTP_POST(
this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/auditors',
this.submitPostData,
`提交[${this.typeText}]时发生错误`
)

if (!success) {
this.userAssignDisable = false
uni.hideLoading();
return
}
uni.hideLoading();
this.EMIT('task-list-change')
this.NAV_BACK(2)
this.TOAST(`已成功提交${this.typeText}`, 'success')

},
newguid() {
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},

// 点击「提交」按钮
async submit() {
if (this.type === 'sign' && !this.staff) {
this.CONFIRM('请补全必填项', '必须指定一个加签用户')
return
}

if (!this.remark) {
this.TOAST(`请签署审批意见`)
return false;
}

this.submitDisable = true
uni.showLoading({
title: '提交中...'
});

const postData = {
operationCode: this.taskParam.code,
operationName: this.taskParam.name,
processId: this.taskParam.processId,
taskId: this.taskParam.taskId,
des: this.remark,
formreq: this.taskParam.formreq,
stamp: this.ConfirmSign
}


if (this.type === 'sign') {
postData.userId = this.staff
} else {
postData.auditors = this.taskParam.auditors
}

// 需要手写签名时,将 canvas 导出为 base64 格式
// 各个平台写法均不相同,需要注意
if (Number(this.taskParam.isSign) === 1) {
// H5 平台,canvasToTempFilePath 的结果直接为画布的 base64
// #ifdef H5
const [err, {
tempFilePath
}] = await uni.canvasToTempFilePath({
canvasId: 'sign-canvas'
})
postData.signUrl = tempFilePath
// #endif

// App 平台,canvasToTempFilePath 输出文件,上传后台转为 base64 格式
// #ifdef APP-VUE
const [err, {
tempFilePath
}] = await uni.canvasToTempFilePath({
canvasId: 'sign-canvas'
})
const signBase64 = await this.HTTP_UPLOAD2('/learun/adms/annexes/wxbase64', tempFilePath, {
folderId: this.newguid()
})
postData.signUrl = 'data:image/png;base64,' + signBase64
// #endif

// 微信小程序,canvasToTempFilePath 输出文件,使用文件管理器以 base64 格式读取文件即可
// #ifdef MP-WEIXIN
const [err, {
tempFilePath
}] = await uni.canvasToTempFilePath({
canvasId: 'sign-canvas'
})
postData.signUrl = 'data:image/png;base64,' + uni.getFileSystemManager().readFileSync(tempFilePath,
'base64')
// #endif

// #ifdef MP-ALIPAY
// 钉钉小程序,context.toTempFilePath 输出文件,上传后台转为 base64 格式
// #ifdef MP-DINGTALK
const filePath = await new Promise((res, rej) => {
context.toTempFilePath({
success: ({
filePath
}) => {
res(filePath)
},
fail: () => {
rej()
}
})
})

const signBase64 = await this.HTTP_UPLOAD('/annexes/wxtobase64', filePath)
postData.signUrl = 'data:image/png;base64,' + signBase64
// #endif

// 支付宝小程序,context.toDataURL 直接输出 base64 字符串
// #ifndef MP-DINGTALK
postData.signUrl = await context.toDataURL('image/png', 1)
// #endif
// #endif
}

// 是否需要指派审核人
let isNext = this.taskParam.currentNode.isNext
if (this.taskParam.next == '2') {
isNext = '1';
}
if (isNext == '1') {
let params = {
code: this.taskParam.schemeCode,
processId: this.taskParam.processId,
taskId: this.taskParam.taskId,
nodeId: this.taskParam.currentNode.id,
operationCode: this.taskParam.code,
}
const userList = await this.HTTP_GET('learun/adms/newwf/auditer', params, `获取审核人时发生错误`)
// if (!userList) {
// return
// }

if (Object.keys(userList).length == 0) {
const success = await this.HTTP_POST(
this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/audit',
postData,
`提交[${this.typeText}]时发生错误`
)

if (!success) {
this.submitDisable = false
uni.hideLoading();
return
}

this.EMIT('task-list-change')
this.NAV_BACK(2)
this.TOAST(`已成功提交${this.typeText}`, 'success')
return;
}
let arr = Object.entries(userList)
this.reviewerListId = arr[0][0]
this.reviewerList = arr[0][1].map(item => {
return {
text: item.Name,
value: item.Id
}
})
this.submitPostData = postData
if (this.reviewerList.length > 1) {
this.submitDisable = false
uni.hideLoading();
this.modal = true
return
}

}



const success = await this.HTTP_POST(
this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/audit',
postData,
`提交[${this.typeText}]时发生错误`
)

if (!success) {
this.submitDisable = false
uni.hideLoading();
return
}

this.EMIT('task-list-change')
this.NAV_BACK(2)
uni.hideLoading();
this.TOAST(`已成功提交${this.typeText}`, 'success')
},

// 手写板事件(开始拖动)
signStart(e) {
touchs.push({
x: e.changedTouches[0].x,
y: e.changedTouches[0].y
})
},

// 手写板事件(拖动签名)
signMove(e) {
touchs.push({
x: e.touches[0].x,
y: e.touches[0].y
})
this.drawLine()
},

// 手写板事件(签名结束)
signEnd(e) {
touchs = []
},

// 手写板事件(绘出线型)
drawLine() {
if (touchs.length < 2) {
return
}

const [p1, p2] = touchs
touchs.shift()
context.moveTo(p1.x, p1.y)
context.lineTo(p2.x, p2.y)
context.stroke()
context.draw(true)
},

// 清除手写板
// 阿里小程序无法使用 clearRect 来清空,因此直接重新渲染 canvas
clearSign() {
// #ifndef MP-ALIPAY
context.clearRect(0, 0, 9999, 9999)
context.draw()
context.setStrokeStyle('#000')
context.setLineWidth(5)
context.setLineCap('round')
context.setLineJoin('round')
// #endif

// #ifdef MP-ALIPAY
// 阿里系小程序无法 clearRect 清空画布,必须重新渲染 canvas
this.canvas = false
this.$nextTick(() => {
this.canvasInit()
})
// #endif
},
clearcom() {
this.Signimg = ''
this.ConfirmSign = ''
}
}
// let formdata = new FormData()
// formdata.append("data",this.taskParam.formreq)
const res = await this.HTTP_POST('learun/adms/newwf/instance', this.taskParam.formreq, `指派审核人时发生错误`)
if(!res){
return
}
this.submitPostData.auditors = JSON.stringify({[this.reviewerListId]:this.reviewer.toString()})
delete this.submitPostData.formreq
// this.submitPostData.auditors[this.reviewerListId] = this.reviewer
// console.log(this.submitPostData)
uni.showLoading({
title: '提交中...'
});
const success = await this.HTTP_POST(
this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/auditors',
this.submitPostData,
`提交[${this.typeText}]时发生错误`
)
if (!success) {
uni.hideLoading();
return
}
this.EMIT('task-list-change')
this.NAV_BACK(2)
uni.hideLoading();
this.TOAST(`已成功提交${this.typeText}`, 'success')
},
newguid() {
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},

// 点击「提交」按钮
async submit() {
if (this.type === 'sign' && !this.staff) {
this.CONFIRM('请补全必填项', '必须指定一个加签用户')
return
}

const postData = {
operationCode: this.taskParam.code,
operationName: this.taskParam.name,
processId: this.taskParam.processId,
taskId: this.taskParam.taskId,
des: this.remark,
formreq: this.taskParam.formreq
}

if (this.type === 'sign') {
postData.userId = this.staff
} else {
postData.auditors = this.taskParam.auditors
}

// 需要手写签名时,将 canvas 导出为 base64 格式
// 各个平台写法均不相同,需要注意
if (Number(this.taskParam.isSign) === 1) {
// H5 平台,canvasToTempFilePath 的结果直接为画布的 base64
// #ifdef H5
const [err, { tempFilePath }] = await uni.canvasToTempFilePath({ canvasId: 'sign-canvas' })
postData.signUrl = tempFilePath
// #endif

// App 平台,canvasToTempFilePath 输出文件,上传后台转为 base64 格式
// #ifdef APP-VUE
const [err, { tempFilePath }] = await uni.canvasToTempFilePath({ canvasId: 'sign-canvas' })
const signBase64 = await this.HTTP_UPLOAD2('/learun/adms/annexes/wxbase64',tempFilePath,{folderId:this.newguid()})
postData.signUrl = 'data:image/png;base64,' + signBase64
// #endif

// 微信小程序,canvasToTempFilePath 输出文件,使用文件管理器以 base64 格式读取文件即可
// #ifdef MP-WEIXIN
const [err, { tempFilePath }] = await uni.canvasToTempFilePath({ canvasId: 'sign-canvas' })
postData.signUrl = 'data:image/png;base64,' + uni.getFileSystemManager().readFileSync(tempFilePath, 'base64')
// #endif

// #ifdef MP-ALIPAY
// 钉钉小程序,context.toTempFilePath 输出文件,上传后台转为 base64 格式
// #ifdef MP-DINGTALK
const filePath = await new Promise((res, rej) => {
context.toTempFilePath({
success: ({ filePath }) => {
res(filePath)
},
fail: () => {
rej()
}
})
})

const signBase64 = await this.HTTP_UPLOAD('/annexes/wxtobase64', filePath)
postData.signUrl = 'data:image/png;base64,' + signBase64
// #endif

// 支付宝小程序,context.toDataURL 直接输出 base64 字符串
// #ifndef MP-DINGTALK
postData.signUrl = await context.toDataURL('image/png', 1)
// #endif
// #endif
}
// 是否需要指派审核人
let isNext = this.taskParam.currentNode.isNext
if (this.taskParam.next == '2') {
isNext = '1';
}
if (isNext == '1') {
let params = {
code: this.taskParam.schemeCode,
processId: this.taskParam.processId,
taskId: this.taskParam.taskId,
nodeId: this.taskParam.currentNode.id,
operationCode: this.taskParam.code,
}
const userList = await this.HTTP_GET('learun/adms/newwf/auditer', params, `获取审核人时发生错误`)
if (!userList) {
return
}
let arr = Object.entries(userList)
this.reviewerListId = arr[0][0]
this.reviewerList = arr[0][1].map(item => {
return {
text: item.Name,
value: item.Id
}
})
this.submitPostData = postData
if(this.reviewerList.length>1){
this.modal = true
return
}
}

const success = await this.HTTP_POST(
this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/audit',
postData,
`提交[${this.typeText}]时发生错误`
)

if (!success) {
return
}

this.EMIT('task-list-change')
this.NAV_BACK(2)
this.TOAST(`已成功提交${this.typeText}`, 'success')
},

// 手写板事件(开始拖动)
signStart(e) {
touchs.push({
x: e.changedTouches[0].x,
y: e.changedTouches[0].y
})
},

// 手写板事件(拖动签名)
signMove(e) {
touchs.push({
x: e.touches[0].x,
y: e.touches[0].y
})
this.drawLine()
},

// 手写板事件(签名结束)
signEnd(e) {
touchs = []
},

// 手写板事件(绘出线型)
drawLine() {
if (touchs.length < 2) {
return
}

const [p1, p2] = touchs
touchs.shift()
context.moveTo(p1.x, p1.y)
context.lineTo(p2.x, p2.y)
context.stroke()
context.draw(true)
},

// 清除手写板
// 阿里小程序无法使用 clearRect 来清空,因此直接重新渲染 canvas
clearSign() {
// #ifndef MP-ALIPAY
context.clearRect(0, 0, 9999, 9999)
context.draw()
context.setStrokeStyle('#000')
context.setLineWidth(5)
context.setLineCap('round')
context.setLineJoin('round')
// #endif

// #ifdef MP-ALIPAY
// 阿里系小程序无法 clearRect 清空画布,必须重新渲染 canvas
this.canvas = false
this.$nextTick(() => {
this.canvasInit()
})
// #endif
}
}
}
}
</script>

<style lang="less" scoped>
.sign-area {
min-height: 500rpx;
margin: 23rpx;
border: 2rpx dashed #444444;

.sign-canvas {
width: 700rpx;
height: 500rpx;
}

.sign-action {
text-align: right;
}
}
</style>
.sign-area {
min-height: 500rpx;
margin: 23rpx;
border: 2rpx dashed #444444;

.sign-canvas {
width: 700rpx;
height: 500rpx;
}

.sign-action {
text-align: right;
}
}

.pswd-uni-mask {
position: fixed;
z-index: 999;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .5);
}

.pswd-uni-modal {
position: fixed;
z-index: 999;
width: 80%;
max-width: 300px;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #fff;
text-align: center;
border-radius: 3px;
overflow: hidden;
}

.pswd-uni-modal__hd {
padding: 1em 1.6em 0.3em;
}

.pswd-strong {
font-weight: 400;
font-size: 18px;
}

.pswd-uni-modal__ft {
position: relative;
line-height: 48px;
font-size: 18px;
display: -webkit-box;
display: -webkit-flex;
display: flex;
}

.pswd-uni-modal__ft::after {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1px solid #d5d5d6;
color: #d5d5d6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
}

.pswd-uni-modal__btn {
display: block;
-webkit-box-flex: 1;
/* -webkit-flex: 1; */
flex: 1;
color: #3cc51f;
text-decoration: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
cursor: pointer;
}

.pswd__btn_primary::after {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 1px solid #d5d5d6;
color: #d5d5d6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleX(.5);
transform: scaleX(.5);
}

.pswdinp {
background: #f5f5f5;

}

.Signwrap {
margin: 11px;
border: 1px dashed #444444;
background: #ffffff;
}
</style>

Ladataan…
Peruuta
Tallenna