/** * 详情处理表单数据 * @param res 详情返回数据 * @param templateFormAndTableRef 表单公共组件ref */ export function useSolveFormData(res: any, templateFormAndTableRef: any) { // =========================表单组件数据============================================ templateFormAndTableRef.form.dataNo = res.data.dataNo // 检定数据编号 templateFormAndTableRef.form.measureCategory = res.data.measureCategory // 检校类别 templateFormAndTableRef.form.measureCategoryName = res.data.measureCategoryName // 检校类别名称 templateFormAndTableRef.form.customerName = res.data.customerName // 委托单位 templateFormAndTableRef.form.customerAddress = res.data.customerAddress // 委托单位地址 templateFormAndTableRef.form.traceDate = res.data.traceDate // 测试、校准或检定日期 templateFormAndTableRef.form.measureValidDate = res.data.measureValidDate // 检定有效期 setTimeout(() => { templateFormAndTableRef.form.measureAddress = res.data.measureAddress // 测试、校准或检定地点 templateFormAndTableRef.form.temperature = res.data.temperature // 温度 templateFormAndTableRef.form.humidity = res.data.humidity // 相对湿度 }, 2500) templateFormAndTableRef.form.orderId = res.data.orderId // 任务单id templateFormAndTableRef.form.orderNo = res.data.orderNo // 任务单编号 templateFormAndTableRef.form.createUserId = res.data.createUserId // 检定员id templateFormAndTableRef.form.createUserName = res.data.createUserName // 检定员 templateFormAndTableRef.form.dataSource = res.data.dataSource // 数据来源 templateFormAndTableRef.form.conclusion = res.data.conclusion // 结论 templateFormAndTableRef.form.restrictionInstruction = res.data.restrictionInstruction // 限用说明 templateFormAndTableRef.form.itemCategoryName = res.data.itemCategoryName // 设备检定项分类名称 templateFormAndTableRef.form.itemCategoryId = res.data.itemCategoryId // 设备检定项分类名称id templateFormAndTableRef.form.itemId = res.data.itemId templateFormAndTableRef.form.meterIdentify = res.data.meterIdentify // 计量标识 // ============================被检件信息============================================================= templateFormAndTableRef.sampleList = [ { // 被检设备 sampleId: res.data.sampleId, // 设备id sampleName: res.data.sampleName, // 设备名称 sampleModel: res.data.model, // 规格型号 manufactureNo: res.data.manufactureNo, // 出厂编号 manufacturer: res.data.manufacturer, // 制造厂家(生产厂家) categoryName: res.data.itemCategoryName, // 设备检定项分类 helpInstruction: res.data.helpInstruction, // 辅助字段 helpFieldInstruction: res.data.helpFieldInstruction, // 辅助字段说明 }, ] // ==============================测量设备==================================================================== templateFormAndTableRef.measureEquipmentList = res.data.equipmentList.map( (item: any) => { return { ...item, id: item.equipmentId, } }, ) // 所使用的标准,主要测量设备 }