import QtQuick import QtQuick.Controls import QtQuick.Layouts import com.InteractiveTask 1.0 Item { id: materialcheckform x: 290 y: 130 width: 1600 height: 920 property string strMaterialCheckFormGet: "" signal signal_getMaterialCheckForm(int planId); signal signal_postSaveForm(string data); onVisibleChanged: { if (visible === true) { proThread.moveCursorTo(0, 0); } if (visible === false) materialcheckform_dialog_confirm.close(); } PromptInfo { id: materialcheckform_prompt_info; } Connections { target: materialcheckform onVisibleChanged: { if (materialcheckform.visible === true) { waitPromptBox.show(); signal_getMaterialCheckForm(materialCheckPlan.planId); } else { materialcheckform_tableModel.clear(); materialcheckform_tableModel_standard.clear(); } } } ListModel { id: materialcheckform_tableModel // 物资标志 // materialFlag: 0 = 未定义、 1 = 正常、 2 = 损坏、 3 = 过期 // onDataChanged: { // // build_model_view() // } } ListModel { id: materialcheckform_tableModel_standard } Dialog { id: materialcheckform_dialog_confirm title: "操作确认" x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 width: 600 height: 400 clip: true modal: true property int flag: 0; // 自定义背景(带圆角) background: Rectangle { color: "white" clip: true } // 自定义标题栏 header: Rectangle { x: 0 y: 0 width: parent.width height: 50 // 设置标题栏高度 color: "#ff3968e9" // 设置标题栏背景色 // 标题文本 Text { x: 20 y: 0 width: 80 height: 50 // 设置标题栏高度 text: materialcheckform_dialog_confirm.title font.pixelSize: 25 horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter color: "white" } } contentItem: Rectangle { x: 0 y: 0 width: parent.width height: 200 color: "white" Text { id: materialcheckform_text_dialog_item; width: parent.width height: 100 text: "" font.pixelSize: 30 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } } // 单选按钮 Item { id: materialcheckform_item_check x: 0 y: 150 width: parent.width height: 100 Row { anchors.horizontalCenter: parent.horizontalCenter spacing: 20 // 正常单选按钮 Rectangle { id: materialcheckform_btn_normal width: 164 height: 61 color: "#33008000" radius: 20 clip: true ToolButton { anchors.centerIn: parent enabled: false // 不可点击 display: AbstractButton.TextBesideIcon // 文字在图标旁边 icon.source: "" icon.width: 36 icon.height: 30 text: "正常" palette.buttonText: "#ffffff" font { pixelSize: 25 } } MouseArea { anchors.fill: parent onClicked: { materialcheckform_dialog_confirm.flag = (materialcheckform_dialog_confirm.flag === 1 ? 0 : 1); } } } Rectangle { id: materialcheckform_btn_expire; width: 164 height: 61 color: "#33ff9900" radius: 20 clip: true ToolButton { anchors.centerIn: parent enabled: false // 不可点击 display: AbstractButton.TextBesideIcon // 文字在图标旁边 icon.source: "" icon.width: 36 icon.height: 30 text: "过期" palette.buttonText: "#ffffff" font { pixelSize: 25 } } MouseArea { anchors.fill: parent onClicked: { materialcheckform_dialog_confirm.flag = (materialcheckform_dialog_confirm.flag === 2 ? 0 : 2); } } } Rectangle { id: materialcheckform_btn_damage; width: 164 height: 61 color: "#33ff0000" radius: 20 clip: true ToolButton { anchors.centerIn: parent enabled: false // 不可点击 display: AbstractButton.TextBesideIcon // 文字在图标旁边 icon.source: "" icon.width: 36 icon.height: 30 text: "损坏" palette.buttonText: "#ffffff" font { pixelSize: 25 } } MouseArea { anchors.fill: parent onClicked: { materialcheckform_dialog_confirm.flag = (materialcheckform_dialog_confirm.flag === 3 ? 0 : 3); } } } } } // 自定义 DialogButtonBox DialogButtonBox { id: materialcheckform_buttonBox x: 0 y: 250 width: parent.width height: 100 // 自定义按钮 Button { implicitWidth: 120 implicitHeight: 50 text: "确认" background: Rectangle { color: "green" radius: 5 } contentItem: Text { text: parent.text font.pixelSize: 30 color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { if (materialcheckform_dialog_confirm.flag != 0) { for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); if (item.materialFlag === 0) { item.materialFlag = materialcheckform_dialog_confirm.flag; } } } materialcheckform_dialog_confirm.close() } } Button { implicitWidth: 120 implicitHeight: 50 text: "取消" background: Rectangle { color: "red" radius: 5 } contentItem: Text { text: parent.text font.pixelSize: 30 color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { materialcheckform_dialog_confirm.reject() } } } onFlagChanged: { materialcheckform_btn_normal.color= "#33008000"; materialcheckform_btn_expire.color= "#33FF9900"; materialcheckform_btn_damage.color= "#33FF0000"; switch (materialcheckform_dialog_confirm.flag) { case 1:{ materialcheckform_btn_normal.color= "#008000"; }break; case 2:{ materialcheckform_btn_expire.color= "#FF9900"; }break; case 3:{ materialcheckform_btn_damage.color= "#FF0000"; }break; } } } Dialog { id: materialcheckform_dialog_confirm_prompt title: "操作确认" x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 width: 600 height: 400 clip: true modal: true property int flag: 0; // 自定义背景(带圆角) background: Rectangle { color: "white" clip: true } // 自定义标题栏 header: Rectangle { x: 0 y: 0 width: parent.width height: 50 // 设置标题栏高度 color: "#ff3968e9" // 设置标题栏背景色 // 标题文本 Text { x: 20 y: 0 width: 80 height: 50 // 设置标题栏高度 text: materialcheckform_dialog_confirm_prompt.title font.pixelSize: 25 horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter color: "white" } } contentItem: Rectangle { x: 0 y: 0 width: parent.width height: 200 color: "white" Text { id: materialcheckform_text_dialog_prompt; width: parent.width height: 100 text: "" font.pixelSize: 30 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } } // 自定义 DialogButtonBox DialogButtonBox { x: 0 y: 250 width: parent.width height: 100 // 自定义按钮 Button { implicitWidth: 120 implicitHeight: 50 text: "确认" background: Rectangle { color: "green" radius: 5 } contentItem: Text { text: parent.text font.pixelSize: 30 color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { materialcheckform_dialog_confirm_prompt.close(); } } Button { implicitWidth: 120 implicitHeight: 50 text: "取消" background: Rectangle { color: "red" radius: 5 } contentItem: Text { text: parent.text font.pixelSize: 30 color: "white" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked: { materialcheckform_dialog_confirm_prompt.reject() } } } } // 一键检查 Button { id: materialcheckform_btn_onekey_check x: 928 y: 835 width: 192 height: 75 background: Rectangle { color: "#ff9900" // 设置背景为透明 radius: 10 // 可选,设置圆角 } text: qsTr("一键检查") font.pixelSize: 30 palette.buttonText: "white" // 设置字体颜色为绿色 Connections { target: materialcheckform_btn_onekey_check onClicked: { var iCount = 0; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); if (item.materialFlag === 0) { iCount++; } } var strText; if (iCount > 0) { strText = "将待检查的" + iCount + "件物资,全部标注为:"; materialcheckform_item_check.visible = true; } else { strText = "没有待检查的物资"; materialcheckform_item_check.visible = false; } materialcheckform_text_dialog_item.text = strText; materialcheckform_dialog_confirm.open(); } } } // 保存 Button { id: materialcheckform_btn_save x: 1168 y: 835 width: 192 height: 75 background: Rectangle { color: "#ff0000" // 设置背景为透明 radius: 10 // 可选,设置圆角 } text: qsTr("保存") font.pixelSize: 30 palette.buttonText: "white" // 设置字体颜色为绿色 Connections { target: materialcheckform_btn_save onClicked: { infoPromptBox.title("操作确认"); infoPromptBox.message("确定要保存检查结果吗?"); infoPromptBox.button_clear(); infoPromptBox.button_push("red", "取消", null, null); infoPromptBox.button_push( "#055eb3", "确定", ()=>{ var taskType = InteractiveTask.TypeHttpPost_insertCheckRecord; var jsonObjRoot = {}; var jsonArrList = []; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); var jsonObjList = item.materialJson; if (item.materialFlag === 0) { jsonObjList["status"] = ""; jsonObjList["reason"] = ""; } else if (item.materialFlag === 1) { jsonObjList["status"] = "0"; jsonObjList["reason"] = ""; } else if (item.materialFlag === 2) { jsonObjList["status"] = "1"; jsonObjList["reason"] = "2"; } else if (item.materialFlag === 3) { jsonObjList["status"] = "1"; jsonObjList["reason"] = "1"; } jsonArrList.push(jsonObjList); } jsonObjRoot["list"] = jsonArrList; var strJson = JSON.stringify(jsonObjRoot); // 添加提交任务 interactiveCore.appendTask( taskType, strJson, (json)=>{ var jsonObjRoot = JSON.parse(json); if (jsonObjRoot.code === 200) { var iWait = 0; var iNormal = 0; var iExpire = 0; var iDamage = 0; var text = ""; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); switch (item.materialFlag) { case 0: iWait++; break; case 1: iNormal++; break; case 2: iExpire++; break; case 3: iDamage++; break; } } materialcheckform_text_wait_check.text = "待检查:" + iWait materialcheckform_text_normal_check.text = "正常:" + iNormal materialcheckform_text_expire_check.text = "过期:" + iExpire materialcheckform_text_damage_check.text = "损坏:" + iDamage if (iWait > 0) { text = "保存成功,还有" + iWait + "件物资待检查"; } else { text = "保存成功,没有物资待检查"; } infoPromptBox.title("保存成功"); infoPromptBox.message(text); infoPromptBox.button_clear(); infoPromptBox.button_push("#055eb3", "确定", null, null); infoPromptBox.show(); } else { infoPromptBox.title("保存失败"); infoPromptBox.message(jsonObjRoot.msg); infoPromptBox.button_clear(); infoPromptBox.button_push("#055eb3", "确定", null, null); infoPromptBox.show(); } }); }, null); infoPromptBox.show(); } } } // 返回按钮 Button { id: materialcheckform_btn_return x: 1408 y: 835 width: 192 height: 75 background: Rectangle { color: "#055eb3" // 设置背景为透明 radius: 10 // 可选,设置圆角 } text: qsTr("返回") font.pixelSize: 30 palette.buttonText: "white" // 设置字体颜色为绿色 Connections { target: materialcheckform_btn_return onClicked: { if (pConfig.sopenDoor) { infoPromptBox.title("提示"); infoPromptBox.message("开柜状态下不允许该操作"); infoPromptBox.button_clear(); infoPromptBox.button_push("#055eb3", "确定", null, null); infoPromptBox.show(); } else { materialcheckform.visible = false; materialCheckPlan.visible = true; mainScreen.changeModel_text("物资检查"); mainScreen.resetLogin_timeout(); } } } } // 待检查 文字区域 Text { id: materialcheckform_text_wait_check x: 0 y: 810 width: 1600 height: 90 text: "待检查:0" font.pixelSize: 30 color: "#d7d7d2" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter leftPadding: 20 // 添加左边距使文本不紧贴边缘 } // 正常 文字区域 Text { id: materialcheckform_text_normal_check x: 0 y: 810 width: 1600 height: 90 text: "正常:0" font.pixelSize: 30 color: "#d7d7d2" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter leftPadding: 250 // 添加左边距使文本不紧贴边缘 } // 过期 文字区域 Text { id: materialcheckform_text_expire_check x: 0 y: 810 width: 1600 height: 90 text: "过期:0" font.pixelSize: 30 color: "#d7d7d2" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter leftPadding: 450 // 添加左边距使文本不紧贴边缘 } // 损坏 文字区域 Text { id: materialcheckform_text_damage_check x: 0 y: 810 width: 1600 height: 90 text: "损坏:0" font.pixelSize: 30 color: "#d7d7d2" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter leftPadding: 650 // 添加左边距使文本不紧贴边缘 } // 主体区域 Rectangle { id: materialcheckform_rect_main width: 1600 height: 800 color: "#272b7ae9" radius: 20 clip: true // 表格区域 Rectangle { x: 0 y: 0 width: 1110 height: 800 color: "#272b7ae9" radius: 20 // 表格 Column { anchors.fill: parent spacing: 0 // 表头 Row { id: materialcheckform_header width: parent.width height: 100 spacing: 0 // 编号 Rectangle { width: 100 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "编号" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } // 物资类型 Rectangle { width: 140 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "物资类型" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } // 物资名称 Rectangle { width: 180 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "物资名称" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } // RFID Rectangle { width: 220 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "RFID" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } // 正常 Rectangle { width: 80 height: parent.height color: "#33ffffff" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_normal.png" fillMode: Image.PreserveAspectFit } } // 过期 Rectangle { width: 80 height: parent.height color: "#33ffffff" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_expire.png" fillMode: Image.PreserveAspectFit } } // 损坏 Rectangle { width: 80 height: parent.height color: "#33ffffff" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_damage.png" fillMode: Image.PreserveAspectFit } } // 措施 Rectangle { width: 230 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "措施" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } } // 表格内容 ListView { width: parent.width height: parent.height - materialcheckform_header.height clip: true model: materialcheckform_tableModel property var _materialTextArr: []; delegate: Row { width: 1110 height: Math.max(materialNameRfid.implicitHeight, 100) spacing: 0 QtObject { id: itemData property int flag: model.materialFlag onFlagChanged: { materialcheckform_rect_normal.color= "#272b7ae9"; materialcheckform_rect_expire.color= "#272b7ae9"; materialcheckform_rect_damage.color= "#272b7ae9"; switch (flag) { case 1:{ materialcheckform_rect_normal.color= "#008000"; }break; case 2:{ materialcheckform_rect_expire.color= "#FF9900"; }break; case 3:{ materialcheckform_rect_damage.color= "#FF0000"; }break; } } } // 编号 Rectangle { width: 100 height: parent.height color: "#272b7ae9" border.color: "#47bfff" clip: true Text { anchors.centerIn: parent font.pixelSize: 20 color: "#d7d7d2" text: model.materialCode wrapMode: Text.WordWrap } } // 物资类型 Rectangle { width: 140 height: parent.height color: "#272b7ae9" border.color: "#47bfff" clip: true ToolButton { anchors.centerIn: parent enabled: false // 不可点击 display: AbstractButton.TextUnderIcon icon.source: model.materialIcon icon.width: 36 icon.height: 30 text: model.materialType palette.buttonText: "#d7d7d2" font { pixelSize: 20 } } } // 物资名称 Rectangle { width: 180 height: parent.height color: "#272b7ae9" border.color: "#47bfff" clip: true Text { anchors.centerIn: parent font.pixelSize: 20 color: "#d7d7d2" text: model.materialName wrapMode: Text.WordWrap } } // RFID Rectangle { width: 220 height: parent.height color: "#272b7ae9" border.color: "#47bfff" clip: true Text { id: materialNameRfid width: parent.width - 10 // 留点边距 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap font.pixelSize: 20 color: "#d7d7d2" text: model.materialRfid elide: Text.ElideRight ToolTip { visible: materialNameRfid.truncated && textHoverArea.containsMouse delay: 500 text: materialNameRfid.text } MouseArea { id: textHoverArea anchors.fill: parent hoverEnabled: true } } } // 正常 Rectangle { id: materialcheckform_rect_normal width: 80 height: parent.height color: "#272b7ae9" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_normal.png" fillMode: Image.PreserveAspectFit } MouseArea { anchors.fill: parent // 让MouseArea覆盖整个Image区域 onClicked: { model.materialFlag = (model.materialFlag === 1 ? 0 : 1); model.materialText = (model.materialFlag === 1 ? "" : "") } } } // 过期 Rectangle { id: materialcheckform_rect_expire width: 80 height: parent.height color: "#272b7ae9" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_expire.png" fillMode: Image.PreserveAspectFit } MouseArea { anchors.fill: parent // 让MouseArea覆盖整个Image区域 onClicked: { model.materialFlag = (model.materialFlag === 2 ? 0 : 2); model.materialText = (model.materialFlag === 2 ? "更换" : "") } } } // 损坏 Rectangle { id: materialcheckform_rect_damage width: 80 height: parent.height color: "#272b7ae9" border.color: "#47bfff" Image { anchors.centerIn: parent visible: true source: "qrc:/png/title_damage.png" fillMode: Image.PreserveAspectFit } MouseArea { anchors.fill: parent // 让MouseArea覆盖整个Image区域 onClicked: { model.materialFlag = (model.materialFlag === 3 ? 0 : 3); model.materialText = (model.materialFlag === 3 ? "更换或维修" : "") } } } // 措施 Rectangle { width: 230 height: parent.height color: "#272b7ae9" border.color: "#47bfff" clip: true Text { anchors.centerIn: parent font.pixelSize: 20 color: "#d7d7d2" font.bold: true text: model.materialText wrapMode: Text.WordWrap } } } } } } // 检查标准 Rectangle { x: 1140 y: 0 width: 460 height: 800 color: "#272b7ae9" radius: 20 // Column { anchors.fill: parent spacing: 0 // Row { id: materialcheckform_header_standard width: parent.width height: 100 spacing: 0 // 编号 Rectangle { width: 460 height: parent.height color: "#33ffffff" border.color: "#47bfff" Text { anchors.centerIn: parent text: "检查标准" font.pixelSize: 25 color: "#d7d7d2" font.bold: true } } } // 表格内容 ListView { width: parent.width height: parent.height - materialcheckform_header_standard.height clip: true model: materialcheckform_tableModel_standard delegate: Row { id: materialcheckform_content_row; width: parent.width spacing: 0 // 文本内容 Rectangle { width: parent.width height: parent.height color: "#272b7ae9" border.color: "#47bfff" ToolButton { id : materialcheckform_content_head anchors.centerIn: parent enabled: false // 不可点击 display: AbstractButton.TextBesideIcon // 文字在图标旁边 icon.source: model.standardIcon icon.width: 45 icon.height: 37 text: model.standardType palette.buttonText: "#d7d7d2" font { pixelSize: 30 } } Text { id : materialcheckform_content_text width: parent.width; anchors.centerIn: parent font.pixelSize: 20 color: "#d7d7d2" font.bold: true wrapMode: Text.WordWrap text: model.standardText } Component.onCompleted: { if (model.standardHead) { materialcheckform_content_row.height = 100; materialcheckform_content_head.visible = true; materialcheckform_content_text.visible = false; } else { materialcheckform_content_row.height = materialcheckform_content_text.implicitHeight; materialcheckform_content_head.visible = false; materialcheckform_content_text.visible = true; } } } } } } } } function slot_getMaterialCheckForm(data) { slot_postSaveForm(data); strMaterialCheckFormGet = data; materialcheckform_tableModel.clear(); materialcheckform_tableModel_standard.clear(); var jsonObjRoot = JSON.parse(data); if (jsonObjRoot.code === 200) { var jsonObjData = jsonObjRoot.data; // 物资检查列表 var jsonArrList = jsonObjData.list; for (var i = 0; i < jsonArrList.length; ++i) { var jsonObjList = jsonArrList[i]; var materialCode = jsonObjList.materialsId; var materialType = jsonObjList.materialsTypeName; var materialIcon = jsonObjList.materialsTypeIcon; var materialName = jsonObjList.materialsName; var materialRfid = jsonObjList.materialsRfid; var materialText = jsonObjList.measure; materialRfid = (materialRfid === null ? "" : materialRfid); materialText = (materialText === null ? "" : materialText); var materialFlag = 0; if(jsonObjList.status === "0") { materialFlag = 1; } else if (jsonObjList.status === "1") { if (jsonObjList.reason === "2") { materialFlag = 2; } else if (jsonObjList.reason === "1") { materialFlag = 3; } } materialcheckform_tableModel.append({ materialFlag: materialFlag, materialCode: materialCode, materialType: materialType, materialIcon: materialIcon, materialName: materialName, materialRfid: materialRfid, materialText: materialText, materialJson: jsonObjList, }); } // 物资检查标准 var jsonArrStandards = jsonObjData.standards; for (var j = 0; j < jsonArrStandards.length; ++j) { var jsonObjStandard = jsonArrStandards[j]; var standardType = jsonObjStandard.materialsTypeName; var standardIcon = jsonObjStandard.materialsTypeIcon; var standardText = jsonObjStandard.checkStandard; materialcheckform_tableModel_standard.append({ standardHead: true, standardType: standardType, standardIcon: standardIcon, }); materialcheckform_tableModel_standard.append({ standardHead: false, standardText: standardText, }); } } build_model_view() waitPromptBox.hide(); } function build_model_view() { var iWait = 0; var iNormal = 0; var iExpire = 0; var iDamage = 0; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); switch (item.materialFlag) { case 0: iWait++; break; case 1: iNormal++; break; case 2: iExpire++; break; case 3: iDamage++; break; } } materialcheckform_text_wait_check.text = "待检查:" + iWait materialcheckform_text_normal_check.text = "正常:" + iNormal materialcheckform_text_expire_check.text = "过期:" + iExpire materialcheckform_text_damage_check.text = "损坏:" + iDamage } function show_dialog() { var iWait = 0; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); switch (item.materialFlag) { case 0: iWait++; break; } } if (iWait > 0) { materialcheckform_text_dialog_prompt.text = "保存成功,还有" + iWait + "件物资待检查"; materialcheckform_dialog_confirm_prompt.open(); } else { materialcheckform_text_dialog_prompt.text = "保存成功,没有物资待检查"; materialcheckform_dialog_confirm_prompt.open(); } } // 返回检查结果 function save_check_result() { var jsonObjRoot = {}; var jsonArrList = []; for (var i = 0; i < materialcheckform_tableModel.count; i++) { var item = materialcheckform_tableModel.get(i); var jsonObjList = item.materialJson; if (item.materialFlag === 0) { jsonObjList["status"] = ""; jsonObjList["reason"] = ""; } else if (item.materialFlag === 1) { jsonObjList["status"] = "0"; jsonObjList["reason"] = ""; } else if (item.materialFlag === 2) { jsonObjList["status"] = "1"; jsonObjList["reason"] = "2"; } else if (item.materialFlag === 3) { jsonObjList["status"] = "1"; jsonObjList["reason"] = "1"; } jsonArrList.push(jsonObjList); } jsonObjRoot["list"] = jsonArrList; var strJson = JSON.stringify(jsonObjRoot); console.log(jsonObjRoot); signal_postSaveForm(strJson); } function slot_postSaveForm(data) { var jsonObjRoot = JSON.parse(data); if (jsonObjRoot.code === 200) { // materialcheckform_prompt_info.promptInfoTimeout = 3; // materialcheckform_prompt_info.promptInfoText = jsonObjRoot.msg; // materialcheckform_prompt_info.promptInfoIcon = "qrc:/png/error.png" // materialcheckform_prompt_info.promptInfoColor = "#6600ff00" } else { materialcheckform_prompt_info.promptInfoTimeout = 3; materialcheckform_prompt_info.promptInfoText = jsonObjRoot.msg; materialcheckform_prompt_info.promptInfoIcon = "qrc:/png/error.png" materialcheckform_prompt_info.promptInfoColor = "#66ea3a0e" } } }