From bd082aac08b9981715a0ef843b4f8ce64eb413bd Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 26 Feb 2025 18:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../outsourcerEvaluation/evaluationForm.html | 56 ++++++++++++------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html index 556d9fa..b804372 100644 --- a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html +++ b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html @@ -338,30 +338,44 @@ Object.assign(currentRows, formData) currentRows.fileList = fileList - let dataForm = { - templateId: getUrlParam('templateId'), - evaluateId: getUrlParam('id'), - id: getUrlParam('detailsId'), - jsonData: JSON.stringify([currentRows]), - titleFiled: fields.join(','), - } - console.log('提交时的formDat参数', dataForm) - let path = getUrlParam("type") == '0' ? '/outsourcer/saveEvaluateData' : '/outsourcer/updateEvaluateData'; - $.ajax({ - url: ctxPath + path, - type: 'post', - data: dataForm, - success: function (res) { - if (res.res == '1') { - layer.msg('保存成功'); - layer.close(index); // 关闭弹框 - initTable() - } else { - layer.msg(res.resMsg); - } + // 更新当前行的表格数据 + let colsNew = tableView.find('tr[data-index=' + rowIndex + ']').find('td'); + + // 遍历所有列,更新相应的单元格 + colsNew.each(function (index, td) { + // 获取字段名,和表格列的字段对应 + let fieldName = dialogLabelInfo[index]?.field; + + // 如果该列对应的字段存在,则更新该单元格的值 + if (fieldName && currentRows[fieldName] !== undefined) { + $(td).text(currentRows[fieldName]); } }) + // let dataForm = { + // templateId: getUrlParam('templateId'), + // evaluateId: getUrlParam('id'), + // id: getUrlParam('detailsId'), + // jsonData: JSON.stringify([currentRows]), + // titleFiled: fields.join(','), + // } + + // console.log('提交时的formDat参数', dataForm) + // let path = getUrlParam("type") == '0' ? '/outsourcer/saveEvaluateData' : '/outsourcer/updateEvaluateData'; + // $.ajax({ + // url: ctxPath + path, + // type: 'post', + // data: dataForm, + // success: function (res) { + // if (res.res == '1') { + // layer.msg('保存成功'); + // layer.close(index); // 关闭弹框 + // initTable() + // } else { + // layer.msg(res.resMsg); + // } + // } + // }) // 这里可以执行你需要的操作