diff --git a/public/bpic_eli/risk_history.html b/public/bpic_eli/risk_history.html
index 30b2a05..e787d1a 100644
--- a/public/bpic_eli/risk_history.html
+++ b/public/bpic_eli/risk_history.html
@@ -39,6 +39,93 @@
position: relative;
}
+ #error-msg {
+ color: red;
+ margin-top: 5px;
+ font-size: 14px;
+ }
+
+ /* 审批意见弹窗样式 */
+ #examDialogTextarea {
+ //width: 100%;
+ height: 120px;
+ padding: 10px;
+ box-sizing: border-box;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ resize: vertical;
+ font-family: 'Helvetica Neue', Helvetica, 'PingFang SC',
+ 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
+ font-size: 14px;
+ margin: 5px;
+ }
+
+ #examDialogErrorMessage {
+ margin: 0 5px 5px 10px;
+ text-align: left;
+ }
+
+ #examDialogOverlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+ z-index: 999;
+ display: none;
+ }
+
+ #examDialog {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 500px;
+ max-width: 90%;
+ background: #fff;
+ border-radius: 4px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ z-index: 1000;
+ display: none;
+ }
+
+ #examDialog .title {
+ padding: 15px;
+ border-bottom: 1px solid #e8e8e8;
+ position: relative;
+ font-size: 16px;
+ font-weight: 500;
+ }
+
+ #examDialog .dialog-close {
+ position: absolute;
+ top: 12px;
+ right: 12px;
+ width: 24px;
+ height: 24px;
+ line-height: 24px;
+ border: none;
+ background: transparent;
+ font-size: 18px;
+ cursor: pointer;
+ color: #999;
+ }
+
+ #examDialog .dialog-action {
+ padding: 15px;
+ text-align: right;
+ border-top: 1px solid #e8e8e8;
+ }
+
+ #examDialog .dialog-action button {
+ margin-left: 10px;
+ padding: 8px 16px;
+ border-radius: 4px;
+ border: 1px solid #dcdfe6;
+ cursor: pointer;
+ }
+
#error-msg {
text-align: left;
color: Red;
@@ -610,9 +697,10 @@
background: #3498db;
color: white;
border: 1px solid #3498db;
- padding: 10px 20px;
+ padding: 5px 10px;
border-radius: 8px;
- float: right;
+ //float: right;
+ margin-left: 50px;
cursor: pointer;
}
@@ -675,11 +763,11 @@
-
+
@@ -729,6 +817,35 @@
+
+
+
+
+
+ 修改审批意见
+
+
+
+
+
+
+
+
+
@@ -1589,30 +1706,98 @@
// 提交审批意见功能
function submitExam() {
var exam = document.getElementById('exam-textarea')
+ var examDialogTextarea = document.getElementById('examDialogTextarea')
var examErrorMessage = document.getElementById('examErrorMessage')
+ var examDialogErrorMessage = document.getElementById(
+ 'examDialogErrorMessage'
+ )
+
+ // 优先使用弹窗中的文本框
+ var examValue =
+ examDialogTextarea && examDialogTextarea.value
+ ? examDialogTextarea.value
+ : exam.value
+
examErrorMessage.innerHTML = ''
- if (!exam.value) {
- examErrorMessage.innerHTML =
- '请填写审批意见'
+ examDialogErrorMessage.innerHTML = ''
+
+ if (!examValue) {
+ if (
+ examDialogTextarea &&
+ examDialogTextarea.style.display !== 'none'
+ ) {
+ // 在弹窗中显示错误
+ examDialogErrorMessage.innerHTML =
+ '请填写审批意见'
+ } else {
+ // 在原位置显示错误
+ examErrorMessage.innerHTML =
+ '请填写审批意见'
+ }
return false
}
+
// TODO: 实现审批意见提交逻辑
DOMHandler.setServiceUrl(
Config.serviceUrl.riskCheckRecordEx,
JSON.stringify({
resultId: StateManager.resultId,
- approveOpinion: exam.value
+ approveOpinion: examValue
}),
function(res) {
if (res) {
var result = JSON.parse(res)
if (result.content.result === '0') {
+ // 更新原textarea的值
+ if (exam) {
+ exam.value = examValue
+ }
alert('修改审批意见成功')
+ closeExamDialog() // 关闭弹窗
}
}
}
)
}
+
+ // 打开审批意见弹窗
+ function openExamDialog() {
+ var exam = document.getElementById('exam-textarea')
+ var examDialog = document.getElementById('examDialog')
+ var examDialogOverlay = document.getElementById('examDialogOverlay')
+ var examDialogTextarea = document.getElementById('examDialogTextarea')
+
+ // 将原textarea的值设置到弹窗textarea中
+ if (exam && examDialogTextarea) {
+ examDialogTextarea.value = exam.value
+ }
+
+ // 显示弹窗
+ if (examDialog && examDialogOverlay) {
+ examDialog.style.display = 'block'
+ examDialogOverlay.style.display = 'block'
+ }
+ }
+
+ // 关闭审批意见弹窗
+ function closeExamDialog() {
+ var examDialog = document.getElementById('examDialog')
+ var examDialogOverlay = document.getElementById('examDialogOverlay')
+ var examDialogErrorMessage = document.getElementById(
+ 'examDialogErrorMessage'
+ )
+
+ // 隐藏弹窗
+ if (examDialog && examDialogOverlay) {
+ examDialog.style.display = 'none'
+ examDialogOverlay.style.display = 'none'
+ }
+
+ // 清空错误信息
+ if (examDialogErrorMessage) {
+ examDialogErrorMessage.innerHTML = ''
+ }
+ }