#EQD-5843 国联民生-交易确认书编号规则, 客户编号规则, 以及确认书相关的一些调整
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using NPOI.Util;
|
||||
using NPOI.Util;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
using System.Text;
|
||||
using YLErp.BLL;
|
||||
@@ -842,105 +842,259 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
}
|
||||
}
|
||||
|
||||
public (bool, string, DateTime, string) UploadContractFileNew(string contractCode, bool isCounterpartyDoc, UploadFileModel uploadFileModel)
|
||||
/// <summary>
|
||||
/// 单笔交易上传确认书。
|
||||
/// <para>会将该 tradeId 对应的旧 trade_contract_r 置为无效,并新增一条有效记录;同时创建/更新 trade_contract_document 并保存上传文件。</para>
|
||||
/// </summary>
|
||||
public UploadContractFileNewResult UploadContractFileNew(
|
||||
int tradeId,
|
||||
bool useContractCode,
|
||||
string contractCode,
|
||||
bool isCounterpartyDoc,
|
||||
UploadFileModel uploadFileModel)
|
||||
{
|
||||
var nowDate = DateTime.Now;
|
||||
if (tradeId <= 0)
|
||||
{
|
||||
return new UploadContractFileNewResult { Success = false, Message = "请传入参数", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
|
||||
if (!TryValidateUploadContractFileNew(new[] { tradeId }, uploadFileModel, out _, out var errMsg))
|
||||
{
|
||||
return new UploadContractFileNewResult { Success = false, Message = errMsg, OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var msg = "";
|
||||
#region 验证
|
||||
if (string.IsNullOrWhiteSpace(contractCode))
|
||||
{
|
||||
|
||||
return (false, "请传入参数", DateTime.Now, "");
|
||||
}
|
||||
|
||||
|
||||
var db = DbContextFactory.GetYLDbContext();
|
||||
|
||||
var contractDoc = db.trade_contract_document.FirstOrDefault(d => d.Code == contractCode );
|
||||
var contractDocRArr = db.trade_contract_r.Where(O => O.ContractCode == contractDoc.Code && O.Type == contractDoc.Type && O.IsValid).ToArray();
|
||||
var contractDocRF = contractDocRArr.FirstOrDefault();
|
||||
if (contractDoc == null || contractDocRF == null)
|
||||
var trade = db.trade.AsNoTracking().FirstOrDefault(t => t.id == tradeId && t.ValidState != "InValid");
|
||||
if (trade == null)
|
||||
{
|
||||
return (false, "没有相关的确认书文档", DateTime.Now, "");
|
||||
return new UploadContractFileNewResult { Success = false, Message = "未找到交易数据", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (uploadFileModel?.Length > 0)
|
||||
var oldR = db.trade_contract_r
|
||||
.Where(r => r.TradeId == tradeId && r.Type == ContractTypeEnum.Trade && r.IsValid)
|
||||
.OrderByDescending(r => r.id)
|
||||
.FirstOrDefault();
|
||||
|
||||
var oldCode = (oldR?.ContractCode ?? "").Trim();
|
||||
|
||||
var activeCode = "";
|
||||
if (useContractCode)
|
||||
{
|
||||
#region 验证
|
||||
if (PS.Config.ErpElement.SecuritiesEnvironment)
|
||||
activeCode = (contractCode ?? "").Trim();
|
||||
if (string.IsNullOrWhiteSpace(activeCode))
|
||||
{
|
||||
if (System.IO.Path.GetExtension(uploadFileModel.FileName).ToLower() != ".xlsx"
|
||||
&& System.IO.Path.GetExtension(uploadFileModel.FileName).ToLower() != ".xls"
|
||||
&& System.IO.Path.GetExtension(uploadFileModel.FileName).ToLower() != ".pdf"
|
||||
&& System.IO.Path.GetExtension(uploadFileModel.FileName).ToLower() != ".docx"
|
||||
&& System.IO.Path.GetExtension(uploadFileModel.FileName).ToLower() != ".doc")
|
||||
return new UploadContractFileNewResult { Success = false, Message = "合约编号必填", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
|
||||
if (!string.Equals(oldCode, activeCode, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var isExists = new TradeContractGenerateService(OptUser).GetExistsContractCode(new[] { activeCode }).Any();
|
||||
if (isExists)
|
||||
{
|
||||
return (false, "请上传PDF/Word/Excel格式的文件", DateTime.Now, "");
|
||||
return new UploadContractFileNewResult { Success = false, Message = "合约编号已存在", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
}
|
||||
if (PS.Config.ErpElement.SecuritiesEnvironment && uploadFileModel.Length > Modules.SuperviseReportModule.SAC.Model.ReportStatusModel.MaxAnnexLength)//小于30MB
|
||||
{
|
||||
return (false, "上传失败,单笔确认书文件大小不应超过30MB", DateTime.Now, "");
|
||||
}
|
||||
#endregion
|
||||
|
||||
var tradeNumber = "未知";
|
||||
if (contractDocRF != null)
|
||||
{
|
||||
tradeNumber = contractDocRF.TradeNumber;
|
||||
}
|
||||
var filePath = Path.Combine(OtcAppContext.AppDocsPath, "contractdoc", "output");
|
||||
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
|
||||
var stampFileFullName = Path.Combine(filePath, uploadFileModel.FileName);
|
||||
contractDoc.Paths = stampFileFullName.Replace(OtcAppContext.AppDocsPath, "/App_Docs").Replace("\\", "/");
|
||||
contractDoc.FileName = uploadFileModel.FileName;
|
||||
if (File.Exists(stampFileFullName))
|
||||
{
|
||||
File.Delete(stampFileFullName);
|
||||
}
|
||||
|
||||
using var fs = new FileStream(stampFileFullName, FileMode.Create, FileAccess.ReadWrite);
|
||||
|
||||
using var sr = uploadFileModel.OpenReadStream();
|
||||
|
||||
sr.Seek(0, SeekOrigin.Begin);
|
||||
var tempBytes = new byte[sr.Length];
|
||||
sr.Read(tempBytes, 0, tempBytes.Length);
|
||||
fs.Write(tempBytes, 0, tempBytes.Length);
|
||||
|
||||
sr.Close();
|
||||
|
||||
fs.Close();
|
||||
msg = msg.Length > 0 ? msg : "上传成功";
|
||||
}
|
||||
|
||||
#region 更新数据
|
||||
contractDoc.SourceType = isCounterpartyDoc ? 2 : 1; // 对方用印文件=人工上传,否则=系统生成
|
||||
var confrimService = new TradeConfirmService(OptUser, db);
|
||||
foreach (var contractDocR in contractDocRArr)
|
||||
else
|
||||
{
|
||||
new TradeConfirmService(OptUser, db).EditReportStatus(contractDocR.TradeId, true);
|
||||
if (!string.IsNullOrWhiteSpace(oldCode))
|
||||
{
|
||||
activeCode = oldCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
var client = DataCacheProvider.GetClientDataSource().GetData(trade.ClientId);
|
||||
if (string.IsNullOrEmpty(client?.Code))
|
||||
{
|
||||
return new UploadContractFileNewResult { Success = false, Message = "对手方代码缩写缺失,请联系运营组同事维护", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
activeCode = GenerateContractCodeForTrade(db, trade, client?.Code);
|
||||
}
|
||||
}
|
||||
|
||||
db.SaveChanges();
|
||||
#endregion
|
||||
if (string.IsNullOrWhiteSpace(activeCode))
|
||||
{
|
||||
return new UploadContractFileNewResult { Success = false, Message = "合约编号生成失败", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
|
||||
return (true, msg, contractDoc.OptDate.Value, contractDoc.StampDocumentFileName);
|
||||
trade_contract_document oldDoc = null;
|
||||
if (!string.IsNullOrWhiteSpace(oldCode))
|
||||
{
|
||||
oldDoc = db.trade_contract_document.FirstOrDefault(d => d.Code == oldCode && d.Type == ContractTypeEnum.Trade);
|
||||
}
|
||||
|
||||
var oldValidRs = new List<trade_contract_r>();
|
||||
if (oldR != null)
|
||||
{
|
||||
oldValidRs.Add(oldR);
|
||||
oldR.IsValid = false;
|
||||
oldR.OptDate = nowDate;
|
||||
oldR.OptId = OptUser.UserId;
|
||||
oldR.OptName = OptUser.UserName;
|
||||
}
|
||||
|
||||
var newDoc = new trade_contract_document();
|
||||
db.trade_contract_document.Add(newDoc);
|
||||
|
||||
if (oldDoc != null)
|
||||
{
|
||||
newDoc.ValueDate = oldDoc.ValueDate;
|
||||
newDoc.BuyerId = oldDoc.BuyerId;
|
||||
newDoc.BuyerName = oldDoc.BuyerName;
|
||||
newDoc.SellerId = oldDoc.SellerId;
|
||||
newDoc.SellerName = oldDoc.SellerName;
|
||||
newDoc.ContractVersion = oldDoc.ContractVersion;
|
||||
newDoc.FileType = oldDoc.FileType;
|
||||
newDoc.DayNumber = oldDoc.DayNumber;
|
||||
newDoc.ClientId = oldDoc.ClientId;
|
||||
newDoc.Comments = oldDoc.Comments;
|
||||
db.trade_contract_document.Remove(oldDoc);
|
||||
}
|
||||
else
|
||||
{
|
||||
var isGJBuyer = trade.BuySell == "买入";
|
||||
newDoc.ValueDate = valuedateBLL.ValueDate;
|
||||
newDoc.BuyerId = isGJBuyer ? 0 : trade.ClientId;
|
||||
newDoc.BuyerName = isGJBuyer ? (PS.Config.CompanyName ?? "") : trade.ClientName;
|
||||
newDoc.SellerId = isGJBuyer ? trade.ClientId : 0;
|
||||
newDoc.SellerName = isGJBuyer ? trade.ClientName : (PS.Config.CompanyName ?? "");
|
||||
newDoc.ClientId = trade.ClientId;
|
||||
}
|
||||
|
||||
newDoc.Code = activeCode;
|
||||
newDoc.Status = ContractStatusEnum.Draft;
|
||||
newDoc.SourceType = isCounterpartyDoc ? 2 : 1;
|
||||
newDoc.Type = ContractTypeEnum.Trade;
|
||||
newDoc.OptId = OptUser.UserId;
|
||||
newDoc.OptName = OptUser.UserName;
|
||||
newDoc.OptDate = nowDate;
|
||||
|
||||
SaveUploadFile(activeCode, uploadFileModel, out var outputRelativeDir);
|
||||
newDoc.Paths = outputRelativeDir;
|
||||
newDoc.FileName = uploadFileModel.FileName;
|
||||
|
||||
var newR = new trade_contract_r();
|
||||
db.trade_contract_r.Add(newR);
|
||||
newR.TradeId = tradeId;
|
||||
newR.TradeNumber = trade.TradeNumber;
|
||||
newR.ContractCode = activeCode;
|
||||
newR.TradeClearCode = activeCode;
|
||||
newR.Type = ContractTypeEnum.Trade;
|
||||
newR.IsValid = true;
|
||||
newR.OptId = OptUser.UserId;
|
||||
newR.OptName = OptUser.UserName;
|
||||
newR.OptDate = nowDate;
|
||||
|
||||
new TradeConfirmService(OptUser, db).EditReportStatus(tradeId, true);
|
||||
db.SaveChanges();
|
||||
|
||||
return new UploadContractFileNewResult
|
||||
{
|
||||
Success = true,
|
||||
Message = "上传成功",
|
||||
OptDate = newDoc.OptDate ?? nowDate,
|
||||
DocumentPath = newDoc.RelativePath
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogFactory.GetLogger("UploadContractFileNew").Error("UploadContractFileNew出错", ex);
|
||||
return (false, "操作出错", DateTime.Now, "");
|
||||
return new UploadContractFileNewResult { Success = false, Message = "操作出错", OptDate = nowDate, DocumentPath = string.Empty };
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 生成合约编号逻辑:如果是收益互换交易,使用国联的生成规则;否则默认使用 TradeNumber 作为合约编号。
|
||||
/// </summary>
|
||||
/// <param name="db"></param>
|
||||
/// <param name="trade"></param>
|
||||
/// <param name="clientCode"></param>
|
||||
/// <returns></returns>
|
||||
private string GenerateContractCodeForTrade(YLContext db, trade trade,string clientCode)
|
||||
{
|
||||
if (trade.TradeType == "收益互换")
|
||||
{
|
||||
return GuolianContractNoGenerator.Generate(db, trade, clientCode ?? "");
|
||||
}
|
||||
return trade.TradeNumber;
|
||||
}
|
||||
|
||||
private static bool TryValidateUploadContractFileNew(
|
||||
IReadOnlyCollection<int> tradeIds,
|
||||
UploadFileModel uploadFileModel,
|
||||
out HashSet<int> tradeIdSet,
|
||||
out string errMsg)
|
||||
{
|
||||
tradeIdSet = new HashSet<int>();
|
||||
errMsg = null;
|
||||
|
||||
if (tradeIds == null || tradeIds.Count == 0)
|
||||
{
|
||||
errMsg = "请传入参数";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uploadFileModel == null || uploadFileModel.Length <= 0)
|
||||
{
|
||||
errMsg = "请选择需上传的文件";
|
||||
return false;
|
||||
}
|
||||
|
||||
var fileExt = System.IO.Path.GetExtension(uploadFileModel.FileName)?.ToLowerInvariant();
|
||||
if (fileExt != ".xlsx" && fileExt != ".xls" && fileExt != ".pdf" && fileExt != ".docx" && fileExt != ".doc")
|
||||
{
|
||||
errMsg = "请上传PDF/Word/Excel格式的文件";
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var tid in tradeIds)
|
||||
{
|
||||
if (tid > 0)
|
||||
{
|
||||
tradeIdSet.Add(tid);
|
||||
}
|
||||
}
|
||||
if (tradeIdSet.Count == 0)
|
||||
{
|
||||
errMsg = "请传入参数";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存上传的文件到服务器,并返回相对路径和文件名
|
||||
/// </summary>
|
||||
/// <param name="contractCode"></param>
|
||||
/// <param name="uploadFileModel"></param>
|
||||
/// <param name="outputRelativeDir"></param>
|
||||
/// <param name="outputFileName"></param>
|
||||
private static void SaveUploadFile(string contractCode, UploadFileModel uploadFileModel, out string outputRelativeDir)
|
||||
{
|
||||
var outputDir = Path.Combine(OtcAppContext.AppDocsPath, "contractdoc", "output");
|
||||
if (!Directory.Exists(outputDir))
|
||||
{
|
||||
Directory.CreateDirectory(outputDir);
|
||||
}
|
||||
var ext = Path.GetExtension(uploadFileModel.FileName) ?? "";
|
||||
|
||||
var outputFullPath = Path.Combine(outputDir, uploadFileModel.FileName);
|
||||
if (File.Exists(outputFullPath))
|
||||
{
|
||||
File.Delete(outputFullPath);
|
||||
}
|
||||
|
||||
using (var fs = new FileStream(outputFullPath, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||
using (var sr = uploadFileModel.OpenReadStream())
|
||||
{
|
||||
sr.CopyTo(fs);
|
||||
}
|
||||
|
||||
outputRelativeDir = Path.Combine("App_Docs", "contractdoc", "output");
|
||||
}
|
||||
|
||||
|
||||
public string GetSealErrMsg(string code)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace YLErp.Modules.TradeModule.DocGenerateModule
|
||||
{
|
||||
public sealed class UploadContractFileNewResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string Message { get; set; }
|
||||
public DateTime OptDate { get; set; }
|
||||
public string DocumentPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -782,9 +782,9 @@ namespace YLErp.Web.Controllers
|
||||
/// <summary>
|
||||
/// 将上传确认书做成页面
|
||||
/// </summary>
|
||||
public ActionResult confirmBookUploadNew(string Id)
|
||||
public ActionResult confirmBookUploadNew(int tradeId = 0)
|
||||
{
|
||||
ViewBag.Id = Id;
|
||||
ViewBag.TradeId = tradeId;
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -2631,4 +2631,4 @@ namespace YLErp.Web.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2032,22 +2032,16 @@ namespace YLErp.Web.Controllers
|
||||
}
|
||||
return JsonError(msg);
|
||||
}
|
||||
public ActionResult UploadContractFileNew(string encryptId, bool isCounterpartyDoc = false)
|
||||
{
|
||||
public ActionResult UploadContractFileNew(int tradeId, bool isCounterpartyDoc = false, bool useContractCode = false, string contractCode = null)
|
||||
{
|
||||
var uploadFileModel = Request.Form.Files.Count > 0 ? Request.Form.Files[0].ToUploadFileModel() : null;
|
||||
var docId = DataProtectHelper.DecryptInt(encryptId);
|
||||
var contractDoc = db.trade_contract_document.FirstOrDefault(o => o.id == docId);
|
||||
if (contractDoc == null)
|
||||
{
|
||||
return JsonError("未找到确认书数据");
|
||||
}
|
||||
var (flag, msg, optDate, stampPath) = new ConfirmationGenerateService(CurUser).UploadContractFileNew(contractDoc.Code, isCounterpartyDoc, uploadFileModel);
|
||||
|
||||
if (flag)
|
||||
var result = new ConfirmationGenerateService(CurUser).UploadContractFileNew(tradeId, useContractCode, contractCode, isCounterpartyDoc, uploadFileModel);
|
||||
if (result.Success)
|
||||
{
|
||||
return JsonSuccess(msg);
|
||||
return JsonSuccess(result.Message);
|
||||
}
|
||||
return JsonError(msg);
|
||||
return JsonError(result.Message);
|
||||
}
|
||||
|
||||
public ActionResult tradeContractManagementQuery(string tradeNumber)
|
||||
@@ -8967,4 +8961,4 @@ namespace YLErp.Web.Controllers
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
@{
|
||||
@{
|
||||
ViewBag.Title = "confirmBookUploadNew";
|
||||
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
||||
|
||||
var pageObj = new
|
||||
{
|
||||
Id = ViewBag.Id,
|
||||
SendMailId = ViewBag.SendMailId
|
||||
TradeId = ViewBag.TradeId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,26 +22,34 @@
|
||||
var page = @Json.Serialize(pageObj);
|
||||
|
||||
function UploadFiles1() {
|
||||
if (main.isEmpty(page.Id)) {
|
||||
main.message("还未生成确认书,无法上传");
|
||||
var tradeId = page.TradeId;
|
||||
|
||||
if (main.isEmpty(tradeId)) {
|
||||
main.message("缺少交易参数,无法上传");
|
||||
return;
|
||||
}
|
||||
//alert(tradeNumber);
|
||||
var encryptId = page.Id;
|
||||
var files = $("#openFile")[0].files;
|
||||
|
||||
if (files.length <= 0) {
|
||||
main.message("请选择需上传的文件");
|
||||
return;
|
||||
}
|
||||
var description = $("#fileDescription").val();
|
||||
var useContractCode = $("#useContractCode").is(':checked');
|
||||
var contractCode = $("#contractCode").val();
|
||||
|
||||
if (useContractCode && main.isEmpty(contractCode)) {
|
||||
main.message("合约编号必填");
|
||||
return;
|
||||
}
|
||||
|
||||
var data = new FormData();
|
||||
for (var x = 0; x < files.length; x++) {
|
||||
data.append(files[x].name, files[x]);
|
||||
}
|
||||
data.append("encryptId", encryptId);
|
||||
data.append("tradeId", tradeId);
|
||||
data.append("isCounterpartyDoc", $("#isCounterpartyDoc").is(':checked'));
|
||||
data.append("useContractCode", useContractCode);
|
||||
data.append("contractCode", contractCode);
|
||||
|
||||
$.ajax({
|
||||
type: "Post",
|
||||
@@ -67,6 +74,19 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggleContractCode() {
|
||||
var useContractCode = $("#useContractCode").is(':checked');
|
||||
$("#contractCode").prop("disabled", !useContractCode);
|
||||
if (!useContractCode) {
|
||||
$("#contractCode").val("");
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#useContractCode").on("change", toggleContractCode);
|
||||
toggleContractCode();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<div class="yc-panel">
|
||||
@@ -74,6 +94,13 @@
|
||||
<label class="formlabel col-auto">选择文件</label>
|
||||
<div class="col"><input type="file" id="openFile" name="file" accept=".xlsx,.xls,.pdf,.docx,.doc" style="width:90%;" /></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="formlabel col-auto"> </label>
|
||||
<div class="col">
|
||||
<label class="mr-4"><input id="useContractCode" type="checkbox" value="合约编号"> 合约编号</label>
|
||||
<input id="contractCode" class="form-control d-inline-block" style="width:300px;" placeholder="请输入合约编号" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="formlabel col-auto"> </label>
|
||||
<div class="col">
|
||||
@@ -87,4 +114,4 @@
|
||||
<a class="btn btn-primary" onclick="layer.closeMe()"> 取消 </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var valuedate = page.valuedate;
|
||||
var valuedate = page.valuedate;
|
||||
var ContractTypeCtrl;
|
||||
var ReportId;
|
||||
|
||||
@@ -354,8 +354,8 @@ const colModelGrid = (new function () {
|
||||
end: function () { SearchClick(true) }
|
||||
});
|
||||
}
|
||||
this.uploadNew = function (encryptId) {
|
||||
var srcurl = "/TradeConfirmBook/confirmBookUploadNew/?Id=" + encryptId;
|
||||
this.uploadNew = function (tradeId) {
|
||||
var srcurl = "/TradeConfirmBook/confirmBookUploadNew/?tradeId=" + tradeId;
|
||||
main.open("上传确认书", srcurl, {
|
||||
area: ['500px', '420px'],
|
||||
end: function () { SearchClick(true) }
|
||||
@@ -935,8 +935,8 @@ function showToolName(cellValue, options, rowObject) {
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" title='交易确认书未生成或未找到制定确认书文件' disabled readonly=\"true\" value=\"{1}\" />"
|
||||
.template(rowObject.EncryptId, "发送Email");
|
||||
}
|
||||
var canUpload = page.canGenerate == true ? "" : "disabled";
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" value=\"上传确认书\" onclick=\"colModelGrid.uploadNew('{0}')\" {1} />".template(rowObject.MetaDic.ContractEncryptId, canUpload);
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" value=\"上传确认书\" onclick=\"colModelGrid.uploadNew({0})\" />"
|
||||
.template(rowObject.id);
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" title='发送交易确认书到OA系统' onclick=\"sendOA({0})\" value=\"发送OA\" />".template(rowObject.id);
|
||||
return html;
|
||||
}
|
||||
@@ -1321,4 +1321,4 @@ function submitOA(id) {
|
||||
}).fail(function (xhr, status, error) {
|
||||
SearchClick(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ const colModelGrid = (new function () {
|
||||
end: function () { SearchClick(true) }
|
||||
});
|
||||
}
|
||||
this.uploadNew = function (encryptId) {
|
||||
var srcurl = "/TradeConfirmBook/confirmBookUploadNew/?Id=" + encryptId;
|
||||
this.uploadNew = function (tradeId) {
|
||||
var srcurl = "/TradeConfirmBook/confirmBookUploadNew/?tradeId=" + tradeId;
|
||||
main.open("上传确认书", srcurl, {
|
||||
area: ['500px', '420px'],
|
||||
end: function () { SearchClick(true) }
|
||||
@@ -256,7 +256,8 @@ function showToolName(cellValue, options, rowObject) {
|
||||
.template(rowObject.EncryptId, "发送Email");
|
||||
}
|
||||
var canUpload = page.canGenerate == true && rowObject.ContractDocUrl ? "" : "disabled";
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" value=\"上传\" onclick=\"colModelGrid.uploadNew('{0}')\" {1} />".template(rowObject.ContractCode, canUpload);
|
||||
html += "<input type=\"button\" class=\"wentiEdit\" value=\"上传\" onclick=\"colModelGrid.uploadNew({0})\" {1} />"
|
||||
.template(rowObject.tradeIds && rowObject.tradeIds.length > 0 ? rowObject.tradeIds[0] : 0, canUpload);
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user