-
{{ item.label }}
@@ -1046,7 +1046,13 @@ export default {
width: 320,
align: "left",
customFn: (row) => {
- return row.money_way_detail.map(item => item.value).join(',')
+ {
+ return row.money_way_detail.map(item => {
+ return (
{
+ item.value
+ }
)
+ })
+ }
}
},
{
@@ -1930,7 +1936,7 @@ export default {
if (!this.form.showAfterPayment && this.form.before_contract_template) {
// 获取所有输入控件
const inputs = this.$refs.beforePaymentForm.querySelectorAll('input, select, textarea');
-
+
// 遍历所有输入控件,更新值到 HTML
inputs.forEach(input => {
const fieldName = input.getAttribute('data-field');
@@ -1953,10 +1959,10 @@ export default {
}
}
});
-
+
// 获取更新后的 HTML
const beforeFormHtml = this.$refs.beforePaymentForm.innerHTML;
-
+
// 更新模板和保存数据
this.form.before_forms = beforeFormHtml;
}
@@ -1965,7 +1971,7 @@ export default {
if (this.form.showAfterPayment && this.form.contract_template) {
// 获取所有输入控件
const inputs = this.$refs.afterPaymentForm.querySelectorAll('input, select, textarea');
-
+
// 遍历所有输入控件,更新值到 HTML
inputs.forEach(input => {
const fieldName = input.getAttribute('data-field');
@@ -1988,10 +1994,10 @@ export default {
}
}
});
-
+
// 获取更新后的 HTML
const afterFormHtml = this.$refs.afterPaymentForm.innerHTML;
-
+
// 更新模板和保存数据
this.form.forms = afterFormHtml;
}
@@ -2082,29 +2088,29 @@ export default {
this.form.purchaseMethod = ''
this.updateTypeOptions()
},
-
+
handleAffairTypeChange() {
this.form.contractType = ''
this.form.purchaseForm = ''
this.form.purchaseMethod = ''
this.updateTypeOptions()
},
-
+
handleContractTypeChange() {
this.form.purchaseForm = ''
this.form.purchaseMethod = ''
this.updateTypeOptions()
},
-
+
handlePurchaseFormChange() {
this.form.purchaseMethod = ''
this.updateTypeOptions()
},
-
+
handlePurchaseMethodChange() {
this.updateTypeOptions()
},
-
+
updateTypeOptions() {
// 重置所有选项
this.affairTypeOptions = []
@@ -2143,21 +2149,21 @@ export default {
// 获取当前选中的采购子形式
const selectedPurchaseSubForm = this.purchaseSubFormOptions.find(item => item.id === this.form.purchaseSubForm)
-
+
// 如果有采购子形式,使用其children作为采购方式
if (selectedPurchaseSubForm && selectedPurchaseSubForm.children) {
this.purchaseMethodOptions = selectedPurchaseSubForm.children
- }
+ }
// 如果没有采购子形式,使用采购形式的children作为采购方式
else if (selectedPurchaseForm.children) {
this.purchaseMethodOptions = selectedPurchaseForm.children
}
},
-
+
nextStep() {
if (this.currentStep === 1) {
// 验证是否至少选择了一个下拉框
- if (!this.form.category && !this.form.affairType && !this.form.contractType &&
+ if (!this.form.category && !this.form.affairType && !this.form.contractType &&
!this.form.purchaseForm && !this.form.purchaseMethod) {
this.$Message.warning('请至少选择一个选项');
return;
@@ -2167,27 +2173,27 @@ export default {
} else if (this.currentStep === 2) {
// 验证基本信息表单
const visibleFields = [];
-
+
// 检查项目名称是否显示
if (this.showFields.projectName) {
visibleFields.push('name');
}
-
+
// 检查项目类型是否显示
if (this.showFields.projectType) {
visibleFields.push('type');
}
-
+
// 检查预算价格是否显示
if (this.showFields.budgetPrice) {
visibleFields.push('price');
}
-
+
// 检查资金渠道是否显示
if (this.showFields.fundChannel) {
visibleFields.push('moneyWay');
}
-
+
// 检查预算计划是否显示
if (this.showFields.budgetPlan) {
visibleFields.push('plan');
@@ -2232,17 +2238,17 @@ export default {
this.currentStep++;
}
},
-
+
prevStep() {
if (this.currentStep === 3) {
// 如果在事后支付表格,先保存内容
- if (this.form.showAfterPayment &&
- this.form.contract_template &&
- this.form.contract_template.contract_template_fields &&
+ if (this.form.showAfterPayment &&
+ this.form.contract_template &&
+ this.form.contract_template.contract_template_fields &&
this.$refs.afterPaymentForm) {
// 获取所有输入控件
const inputs = this.$refs.afterPaymentForm.querySelectorAll('input, select, textarea');
-
+
// 遍历所有输入控件,更新值到 HTML
inputs.forEach(input => {
const fieldName = input.getAttribute('data-field');
@@ -2265,10 +2271,10 @@ export default {
}
}
});
-
+
// 获取更新后的 HTML
const afterFormHtml = this.$refs.afterPaymentForm.innerHTML;
-
+
// 更新模保存数据
this.form.forms = afterFormHtml;
}
@@ -2283,7 +2289,7 @@ export default {
this.currentStep--;
}
},
-
+
// 获取模版配置参数
async getTemplateConfig() {
try {
@@ -2293,11 +2299,11 @@ export default {
contract_type: this.form.contractType || 0,
purchase_form: this.form.purchaseForm || 0
}
-
+
console.log('请求模版配置参数:', params)
const res = await getContractCategoryTemplateConfigParams(params)
console.log('模版配置返回数据:', res)
-
+
if (res.errcode !== undefined) {
this.$message.error(res.errmsg || '获取模版配置失败')
return
@@ -2313,7 +2319,7 @@ export default {
// 根据返回的配置参数设置表单
this.setFormConfig(res)
-
+
// 在编辑模式下,恢复forms和before_forms的值
if (this.isEditMode) {
this.form.forms = currentForms;
@@ -2327,7 +2333,7 @@ export default {
if (this.form.before_forms && this.form.before_forms.trim() !== '') {
this.form.skipBeforeTemplate = true;
}
-
+
// 进入下一步
this.currentStep++
} catch (error) {
@@ -2339,7 +2345,7 @@ export default {
// 设置表单配置
setFormConfig(config) {
console.log('模版配置参数:', config)
-
+
// 只更新显示/隐藏状态,不影响数据来源
Object.assign(this.showFields, {
projectName: config.project_name === 1, // 项目名称
@@ -2355,13 +2361,13 @@ export default {
let beforeTemplate = config.before_contract_template.template;
if (beforeTemplate && config.before_contract_template.contract_template_fields) {
console.log('处理事前支付表格模板:', config.before_contract_template.contract_template_fields)
-
+
// 遍历字段列表,为每个字段找到对应的控件
config.before_contract_template.contract_template_fields.forEach(field => {
// 在模板中查找 data-field 属性值与字段名相同的控件
const regex = new RegExp(`<[^>]*data-field="${field.field}"[^>]*>`, 'g');
const matches = beforeTemplate.match(regex);
-
+
if (matches) {
matches.forEach(match => {
// 获取控件类型
@@ -2372,15 +2378,15 @@ export default {
else if (match.includes('type="radio"')) controlType = 'radio';
else if (match.includes('