|
|
|
@ -173,7 +173,7 @@ export default {
|
|
|
|
previewContent: '', // 预览内容
|
|
|
|
previewContent: '', // 预览内容
|
|
|
|
showEditDrawer: false,
|
|
|
|
showEditDrawer: false,
|
|
|
|
showPreviewModal: false, // 添加预览模态窗口控制变量
|
|
|
|
showPreviewModal: false, // 添加预览模态窗口控制变量
|
|
|
|
currentTemplateIndex: 8,
|
|
|
|
currentTemplateIndex:3,
|
|
|
|
editForm: {
|
|
|
|
editForm: {
|
|
|
|
field: '', // Renamed from name to field
|
|
|
|
field: '', // Renamed from name to field
|
|
|
|
name: '', // Renamed from label to name (Chinese name)
|
|
|
|
name: '', // Renamed from label to name (Chinese name)
|
|
|
|
@ -465,14 +465,7 @@ export default {
|
|
|
|
<div style="display: none;">\${handler}</div>
|
|
|
|
<div style="display: none;">\${handler}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: center; writing-mode: vertical-lr; text-orientation: upright; letter-spacing: 8px;" rowspan="12">
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: center; writing-mode: vertical-lr; text-orientation: upright; letter-spacing: 8px;" rowspan="12">
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="font-size: 16px;">附单据<div style="display: inline-block;"><div style="display: block;"><input type="text" data-field="receipts" style="width: 50px; height: 50px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);"></div><div style="display: none;">\${receipts}</div></div>张</div>
|
|
|
|
<div style="display: flex; align-items: center; justify-content: center;">
|
|
|
|
|
|
|
|
<span>附单据</span>
|
|
|
|
|
|
|
|
<input type="text" data-field="receipts" style="width: 60px; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2); margin: 0 4px;">
|
|
|
|
|
|
|
|
<span>张</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="display: none;">附单据\${receipts}张</div>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -676,14 +669,14 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="department" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="department" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getDepartment}</div>
|
|
|
|
<div style="display: none;">\${department}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">事由</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">事由</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="reason" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="reason" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getReason}</div>
|
|
|
|
<div style="display: none;">\${reason}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -692,14 +685,14 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="date" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="date" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getDate}</div>
|
|
|
|
<div style="display: none;">\${date}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">就餐地点</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">就餐地点</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="diningLocation" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="diningLocation" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getDiningLocation}</div>
|
|
|
|
<div style="display: none;">\${diningLocation}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -709,7 +702,7 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="visitorCount" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="visitorCount" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getVisitorCount}</div>
|
|
|
|
<div style="display: none;">\${visitorCount}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;" rowspan="2">金额(元)</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;" rowspan="2">金额(元)</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 100px; background-color: #fff; text-align: center; font-weight: normal;">餐费</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 100px; background-color: #fff; text-align: center; font-weight: normal;">餐费</td>
|
|
|
|
@ -717,7 +710,7 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="mealsFee" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="mealsFee" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getMealsFee}</div>
|
|
|
|
<div style="display: none;">\${mealsFee}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -726,14 +719,14 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="accompanyCount" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="accompanyCount" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getAccompanyCount}</div>
|
|
|
|
<div style="display: none;">\${accompanyCount}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 100px; background-color: #fff; text-align: center; font-weight: normal;">住宿费</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 100px; background-color: #fff; text-align: center; font-weight: normal;">住宿费</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;">
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="accommodationFee" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="accommodationFee" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getAccommodationFee}</div>
|
|
|
|
<div style="display: none;">\${accommodationFee}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -742,14 +735,14 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="operator" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="operator" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getOperator}</div>
|
|
|
|
<div style="display: none;">\${operator}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">审核人</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; width: 120px; background-color: #fff; text-align: center; font-weight: normal;">审核人</td>
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<td style="border: 1px solid #000; padding: 8px 12px; font-size: 16px; line-height: 1.5; height: 40px; text-align: left;" colspan="2">
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="reviewer" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="reviewer" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getReviewer}</div>
|
|
|
|
<div style="display: none;">\${reviewer}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@ -758,7 +751,7 @@ export default {
|
|
|
|
<div style="display: block;">
|
|
|
|
<div style="display: block;">
|
|
|
|
<input type="text" data-field="remarks" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
<input type="text" data-field="remarks" style="width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #DCDFE6; border-radius: 4px; background: #fff; color: #333; font-size: 14px; line-height: 1.5; box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: none;">\${getRemarks}</div>
|
|
|
|
<div style="display: none;">\${remarks}</div>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
@ -1719,8 +1712,9 @@ export default {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新字段元数据
|
|
|
|
// 更新字段元数据,保留所有必要的属性
|
|
|
|
this.fieldMetadata[this.editForm.field] = {
|
|
|
|
this.fieldMetadata[this.editForm.field] = {
|
|
|
|
|
|
|
|
field: this.editForm.field, // 确保保留字段名
|
|
|
|
name: this.editForm.name,
|
|
|
|
name: this.editForm.name,
|
|
|
|
type: this.editForm.type,
|
|
|
|
type: this.editForm.type,
|
|
|
|
options: this.editForm.options
|
|
|
|
options: this.editForm.options
|
|
|
|
@ -1785,11 +1779,6 @@ export default {
|
|
|
|
const controlRegex = new RegExp(`<div style="display: block;">[^<]*<[^>]*data-field="${fieldName}"[^>]*>[^<]*<\\/div>[^<]*<div style="display: none;">\\$\\{${fieldName}\\}<\\/div>`, 'g')
|
|
|
|
const controlRegex = new RegExp(`<div style="display: block;">[^<]*<[^>]*data-field="${fieldName}"[^>]*>[^<]*<\\/div>[^<]*<div style="display: none;">\\$\\{${fieldName}\\}<\\/div>`, 'g')
|
|
|
|
|
|
|
|
|
|
|
|
newCodeContent = newCodeContent.replace(controlRegex, (match) => {
|
|
|
|
newCodeContent = newCodeContent.replace(controlRegex, (match) => {
|
|
|
|
// 提取原有的字段名
|
|
|
|
|
|
|
|
const fieldNameMatch = match.match(/<td[^>]*>([^<]+)<\/td>/)
|
|
|
|
|
|
|
|
const originalFieldName = fieldNameMatch ? fieldNameMatch[1] : ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 保留原有的字段名,只替换控件部分
|
|
|
|
|
|
|
|
return `<div style="display: block;">${controlHtml}</div><div style="display: none;">\${${fieldName}}</div>`
|
|
|
|
return `<div style="display: block;">${controlHtml}</div><div style="display: none;">\${${fieldName}}</div>`
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|