|
@@ -497,19 +497,23 @@ func getWordPath(templateId int) string {
|
|
|
|
|
|
//html转pdf数据样式
|
|
|
type html2pdfData struct {
|
|
|
- CompanyName string `description:"甲方名称"`
|
|
|
- ContractCode string `description:"合同编号"`
|
|
|
- Address string `description:"甲方地址"`
|
|
|
- Postcode string `description:"甲方邮编"`
|
|
|
- Phone string `description:"甲方电话"`
|
|
|
- Fax string `description:"传真"`
|
|
|
- Remark string `description:"备注"`
|
|
|
- PayRemark string `description:"支付备注"`
|
|
|
- StartDate string `description:"合同开始日期"`
|
|
|
- EndDate string `description:"合同结束日期"`
|
|
|
- NumYear string `description:"合同有效期"`
|
|
|
- Price string `description:"支付金额"`
|
|
|
- TableHtml string `description:"表格数据"`
|
|
|
+ CompanyName string `description:"甲方名称"`
|
|
|
+ ContractCode string `description:"合同编号"`
|
|
|
+ Address string `description:"甲方地址"`
|
|
|
+ PostcodeDisplay string `description:"甲方邮编;是否展示"`
|
|
|
+ Postcode string `description:"甲方邮编"`
|
|
|
+ PhoneDisplay string `description:"甲方电话;是否展示"`
|
|
|
+ Phone string `description:"甲方电话"`
|
|
|
+ FaxDisplay string `description:"传真;是否展示"`
|
|
|
+ Fax string `description:"传真"`
|
|
|
+ RemarkDisplay string `description:"备注;是否展示"`
|
|
|
+ Remark string `description:"备注"`
|
|
|
+ PayRemark string `description:"支付备注"`
|
|
|
+ StartDate string `description:"合同开始日期"`
|
|
|
+ EndDate string `description:"合同结束日期"`
|
|
|
+ NumYear string `description:"合同有效期"`
|
|
|
+ Price string `description:"支付金额"`
|
|
|
+ TableHtml string `description:"表格数据"`
|
|
|
}
|
|
|
|
|
|
//获取合同样式预览的html
|
|
@@ -527,32 +531,40 @@ func GetHtmlByContractDetail(contractDetail *contract.ContractDetail, htmlType s
|
|
|
//地址
|
|
|
address := contractDetail.Province + contractDetail.City + contractDetail.Address
|
|
|
data := html2pdfData{
|
|
|
- CompanyName: contractDetail.CompanyName,
|
|
|
- ContractCode: contractDetail.ContractCode,
|
|
|
- Address: address,
|
|
|
- Postcode: contractDetail.Postcode,
|
|
|
- Phone: contractDetail.Phone,
|
|
|
- Fax: contractDetail.Fax,
|
|
|
- Remark: contractDetail.Remark,
|
|
|
- PayRemark: contractDetail.PayRemark,
|
|
|
- StartDate: contractDetail.StartDate.Format("2006年01月02日"),
|
|
|
- EndDate: contractDetail.EndDate.Format("2006年01月02日"),
|
|
|
+ CompanyName: contractDetail.CompanyName,
|
|
|
+ ContractCode: contractDetail.ContractCode,
|
|
|
+ Address: address,
|
|
|
+ PostcodeDisplay: "block",
|
|
|
+ Postcode: contractDetail.Postcode,
|
|
|
+ PhoneDisplay: "block",
|
|
|
+ Phone: contractDetail.Phone,
|
|
|
+ FaxDisplay: "block",
|
|
|
+ Fax: contractDetail.Fax,
|
|
|
+ RemarkDisplay: "block",
|
|
|
+ Remark: contractDetail.Remark,
|
|
|
+ PayRemark: contractDetail.PayRemark,
|
|
|
+ StartDate: contractDetail.StartDate.Format("2006年01月02日"),
|
|
|
+ EndDate: contractDetail.EndDate.Format("2006年01月02日"),
|
|
|
}
|
|
|
|
|
|
if data.Postcode == "" {
|
|
|
data.Postcode = "无"
|
|
|
+ data.PostcodeDisplay = "none"
|
|
|
}
|
|
|
if data.Fax == "" {
|
|
|
data.Fax = "无"
|
|
|
+ data.FaxDisplay = "none"
|
|
|
}
|
|
|
if data.Phone == "" {
|
|
|
data.Phone = "无"
|
|
|
+ data.PhoneDisplay = "none"
|
|
|
}
|
|
|
if data.PayRemark == "" {
|
|
|
data.PayRemark = "无"
|
|
|
}
|
|
|
if data.Remark == "" {
|
|
|
data.Remark = "无"
|
|
|
+ data.RemarkDisplay = "none"
|
|
|
}
|
|
|
|
|
|
//合同有效期
|