/** * 柏美 销售合同申请js * @author xuanran.wang */ // 明细表 const detailTable = "detail_2"; // 主表项目字段 const mainProjectId = WfForm.convertFieldNameToId("xmmc"); // 主表流程归档日期 const mainWorkFlowEndId = WfForm.convertFieldNameToId("fhdgdrq"); // 主表实际验收 const mainActualCheckId = WfForm.convertFieldNameToId("sjysrq"); // 明细2付款比例字段 const detail2PayProportionId = WfForm.convertFieldNameToId("skbl",detailTable); // 明细2款项类型 const detail2PaymentTypeId = WfForm.convertFieldNameToId("kxlx",detailTable); // 明细2前后字段 const detail2AroundId = WfForm.convertFieldNameToId("qh",detailTable); // 明细2天数字段 const detail2DayId = WfForm.convertFieldNameToId("ts",detailTable); // 明细2预计付款日期 const detail2ComPayDateId = WfForm.convertFieldNameToId("yjfkrq",detailTable); // 对应日期 const detail2TempDateField = WfForm.convertFieldNameToId("dyrq", detailTable); // 需要计算的款项类型集合 const computeDatePayType = ['2', '4', '5']; // 只读 明细款项类型 const readOnlyArr = []; // 款项类型预计对应日期取值 const paymentTypeGetValue = { 2: (index)=>{ console.log('将主表的 mainWorkFlowEndId : ' + mainWorkFlowEndId + ' val : ' + WfForm.getFieldValue(mainWorkFlowEndId) + ' 赋值给明细 ' + `${detail2TempDateField}_${index}`); WfForm.changeFieldValue(`${detail2TempDateField}_${index}`,{value : WfForm.getFieldValue(mainWorkFlowEndId)}); }, 4: (index)=>{ WfForm.changeFieldValue(`${detail2TempDateField}_${index}`,{value : WfForm.getFieldValue(mainActualCheckId)}); }, 5: (index)=>{ WfForm.changeFieldValue(`${detail2TempDateField}_${index}`,{value : WfForm.getFieldValue(mainActualCheckId)}); } } $(()=>{ init(); }); function init(){ let obj = { 'detailPaymentTypeId':detail2PaymentTypeId, 'detailTempDateId': detail2TempDateField, 'around': detail2AroundId, 'detailComPayDateId': detail2ComPayDateId, 'dayId': detail2DayId, 'computeDatePayType': computeDatePayType, 'paymentTypeGetValue': paymentTypeGetValue, 'readOnlyArr': readOnlyArr } addRowBack(2, obj); changeDetailFieldReadOnly(detailTable, detail2ComPayDateId, detail2PaymentTypeId, readOnlyArr); // 主表字段发生变化 mainFieldChangeDetailCom(mainProjectId, detailTable, obj); // 明细的款项类型字段变化绑定 detailFieldChangeDetailCom(`${detail2PaymentTypeId},${detail2AroundId},${detail2DayId}`, obj); submitCallback(detailTable, detail2PayProportionId); }