debugger; //let id = "{Get}"; let instanceid = "{Get}"; //const recid = this.formData['productionrecordchange-id']; const userno = '{}'; const curtime = '{}'; let glid = this.formData['productionrecordchange-glid'] || ""; if (glid == "") { glid = '{Get}'; this.formData['productionrecordchange-glid'] = glid; } this.linkageAddChilds('', 'productionrecordchange-typed', 'sql', `select 'A'+cast(id as varchar(50)),Record_name from qms_ebr_production_records_sonlist where Associated_ID='${glid}' union all select 'B'+cast(id as varchar(50)),Record_Name from qms_ebr_fqc_records_sonlist where Associated_ID='${glid}'`, '', glid); if (instanceid == undefined || instanceid == "") { this.formData['productionrecordchange-create_by'] = userno; this.formData['productionrecordchange-create_time'] = curtime; let sql = `select pch_show,a.WorkOrd,a.ItemNum,b.batch from qms_ebr_Production_Record_List a left join workordmaster b on a.workord=b.workord where a.id='${glid}'`; utils.getSelect("dopbiz", sql).then((res3) => { if (res3.data && res3.data.rows.length > 0) { let rows = res3.data.rows[0]; this.formData['productionrecordchange-itemnum'] = rows.ItemNum; this.formData['productionrecordchange-workord'] = rows.WorkOrd; this.formData['productionrecordchange-lotserial'] = rows.pch_show; this.formData['productionrecordchange-batch'] = rows.batch; } }); } this.formValidate = function () { let msg = ""; var value = this.formData['productionrecordchange-typed'] || ""; if (value == undefined || value == "") { msg += ",单据类型"; } var lotserial = this.formData['productionrecordchange-lotserial'] || ""; if (lotserial == undefined || lotserial == "") { msg += ",生产批号"; } var reason = this.formData['productionrecordchange-reason'] || ""; if (reason == undefined || reason == "") { msg += ",变更原因"; } var old = this.formData['productionrecordchange-old'] || ""; if (old == undefined || old == "") { msg += ",变更前内容"; } var pnew = this.formData['productionrecordchange-new'] || ""; if (pnew == undefined || pnew == "") { msg += ",变更后内容"; } var batch = this.formData['productionrecordchange-batch'] || ""; if (batch == undefined || batch == "") { msg += ",SAP工单号"; } var text = this.getSelectTitle("productionrecordchange-typed", value).toString(); var workord = this.formData['productionrecordchange-workord'] || ""; if (workord == undefined || workord == "") { //if (text.indexOf('过程检验记录') >= 0 || text.indexOf('成品编号记录表') >= 0 || text.indexOf('产品检测报告') >= 0 || text.indexOf('环氧乙烷灭菌记录') >= 0 || text.indexOf('COC报告') >= 0) { //不必填 // } else { msg += ",工单号"; //} } if (text.indexOf('工序随工单') >= 0 || text.indexOf('前处理随工单') >= 0 || text.indexOf('首件确认单') >= 0) { var op = this.formData['productionrecordchange-op'] || ""; if (op == "") { msg += ",工序号"; } } //if (text.indexOf('清场记录') >= 0) { var descr = this.formData['productionrecordchange-descr'] || ""; var date = this.formData['productionrecordchange-date'] || ""; if (date == "") { msg += ",记录日期"; } if (descr == "") { msg += ",工作地点"; } //} //if (text.indexOf('物料报废单') >= 0) { var date = this.formData['productionrecordchange-date'] || ""; if (date == "") { msg += ",记录日期"; } //} //if (text.indexOf('产品无菌环残') >= 0) { var mjph = this.formData['productionrecordchange-mjph'] || ""; if (mjph == "") { msg += ",灭菌批次"; } //} //if (text.indexOf('产品初始污染') >= 0) { var jcno = this.formData['productionrecordchange-jcno'] || ""; if (jcno == "") { msg += ",初始污染单号"; } //} if (msg !== "") { utils.msg(`${msg.substring(1)}不能为空`, false); return false; } return true; }