| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464 |
- import QtQuick
- import QtQuick.Controls
- import QtQuick.Layouts
- Item {
- id: materialchecksave
- x: 290
- y: 130
- width: 1600
- height: 920
- property int planId: 0
- property string strMaterialCheckPlanGet: ""
- Connections {
- target: materialchecksave
- onVisibleChanged: {
- if (materialchecksave.visible === true)
- {
- build_view();
- }
- }
- }
- ListModel {
- id: materialchecksave_tableModel
- }
- // 确认操作弹出框
- Dialog {
- id: materialchecksave_dialog_confirm
- title: "操作确认"
- x: parent.width / 2 - width / 2
- y: parent.height / 2 - height / 2
- width: 600
- height: 400
- clip: true
- modal: true
- // 自定义背景(带圆角)
- 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: materialchecksave_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 {
- width: parent.width
- height: 200
- text: "确定要提交检查结果吗?"
- font.pixelSize: 30
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- // 自定义 DialogButtonBox
- DialogButtonBox {
- id: materialchecksave_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: {
- mainScreen.changeModel_text("物资检查表");
- submit_check_result();
- materialCheckPlan.visible = true;
- // materialCheckSave.visible = false;
- materialchecksave_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: {
- materialchecksave_dialog_confirm.reject()
- }
- }
- }
- }
- // 提交结果
- Button {
- id: materialcheckform_btn_submit
- 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_submit
- onClicked: {
- materialchecksave_dialog_confirm.open();
- }
- }
- }
- // 继续检查
- Button {
- id: materialchecksave_btn_proceed_check
- x: 1168
- y: 835
- width: 192
- height: 75
- background: Rectangle {
- color: "#ff0000" // 设置背景为透明
- radius: 10 // 可选,设置圆角
- }
- text: qsTr("继续检查")
- font.pixelSize: 30
- palette.buttonText: "white" // 设置字体颜色为绿色
- Connections {
- target: materialchecksave_btn_proceed_check
- onClicked: {
- // materialCheckSave.visible = false;
- materialCheckForm.visible = true;
- mainScreen.resetLogin_timeout();
- }
- }
- }
- // 返回按钮
- Button {
- id: materialchecksave_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: button_return_instructions
- onClicked: {
- // materialCheckSave.visible = false;
- materialSelmodel.visible = true;
- mainScreen.resetLogin_timeout();
- }
- }
- }
- // 主体区域
- Rectangle {
- id: materialchecksave_rect_main
- width: 1600
- height: 800
- color: "#272b7ae9"
- radius: 20
- clip: true
- // 签名
- Rectangle {
- id: materialchecksave_btn_sign
- x: 1400
- y: 25
- width: 180
- height: 50
- color: "#008000"
- radius: 10
- Text
- {
- id: materialchecksave_text_sign
- // anchors.fill: parent
- anchors.centerIn: parent
- text: qsTr("签名")
- font.pixelSize: 30
- color: "#ffffff"
- }
- Image {
- id: materialchecksave_image_sign;
- anchors.fill: parent
- }
- MouseArea
- {
- anchors.fill: parent
- onClicked: {
- // materialCheckSave.visible = false;
- materialCheckSign.visible = true;
- mainScreen.resetLogin_timeout();
- }
- }
- }
- // 计划日期区域
- Text {
- id: materialchecksave_text_plan_date
- x: 0
- y: 0
- width: 1600
- height: 90
- text: "计划日期:"
- font.pixelSize: 30
- color: "#d7d7d2"
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
- leftPadding: 20 // 添加左边距使文本不紧贴边缘
- }
- // 计划状态区域
- Text {
- id: materialchecksave_text_plan_stat
- x: 0
- y: 0
- width: 1600
- height: 90
- text: "计划状态:"
- font.pixelSize: 30
- color: "#d7d7d2"
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
- leftPadding: 360 // 添加左边距使文本不紧贴边缘
- }
- // 表格区域
- Rectangle {
- x: 10
- y: 90
- width: 1580
- height: 700
- color: "#272b7ae9"
- radius: 20
- // 表格
- Column {
- anchors.fill: parent
- spacing: 0
- // 表头
- Row {
- id: materialchecksave_header
- width: parent.width
- height: 100
- spacing: 0
- Repeater {
- model: ["物资类型", "总数量", "借出数量", "待检数量", "正常数量", "过期数量", "损坏数量"]
- Rectangle {
- width: parent.width / 7
- height: parent.height
- color: "#33ffffff"
- border.color: "#47bfff"
- clip: true
- Text {
- anchors.centerIn: parent
- text: modelData
- font.pixelSize: 25
- color: "#d7d7d2"
- font.bold: true
- }
- }
- }
- }
- // 表格内容
- ListView {
- width: parent.width
- height: parent.height - materialchecksave_header.height
- clip: true
- model: materialchecksave_tableModel
- delegate: Row {
- width: 1580
- height: 100
- spacing: 0
- property var rowData: [mainNumber, lendNumber, waitNumber, normalNumber, expireNumber, damageNumber]
- Rectangle {
- width: parent.width / 7
- height: parent.height
- color: "#272b7ae9"
- border.color: "#47bfff"
- ToolButton
- {
- anchors.centerIn: parent
- enabled: false // 不可点击
- display: AbstractButton.TextBesideIcon // 文字在图标旁边
- icon.source: model.materialIcon
- icon.width: 36
- icon.height: 30
- text: model.materialType
- palette.buttonText: "#d7d7d2"
- font {
- pixelSize: 25
- }
- }
- }
- Repeater {
- model: 6
- Rectangle {
- width: parent.width / 7
- height: parent.height
- color: "#272b7ae9"
- border.color: "#47bfff"
- Text {
- anchors.centerIn: parent
- font.pixelSize: 25
- color: "#d7d7d2"
- text: parent.parent.rowData[index]
- }
- }
- }
- }
- }
- }
- }
- }
- function build_view()
- {
- materialchecksave_tableModel.clear();
- var jsonObjRoot = JSON.parse(materialCheckPlan.strMaterialCheckPlanGet);
- if (jsonObjRoot.code === 200)
- {
- var jsonObjData = jsonObjRoot.data;
- planId = jsonObjData.planId;
- var planDate = jsonObjData.planDate;
- var planStat = jsonObjData.status;
- planStat = (planStat === "0" ? "进行中" : planStat === "1" ? "已完成" : "未定义");
- materialchecksave_text_plan_date.text = "计划日期:" + planDate;
- materialchecksave_text_plan_stat.text = "计划状态:" + planStat;
- var jsonArrList = jsonObjData.list;
- for (var i = 0; i < jsonArrList.length; ++i)
- {
- var jsonObjList = jsonArrList[i];
- var materialType = jsonObjList.materialsTypeName;
- var materialIcon = jsonObjList.materialsTypeIcon;
- var mainNumber = jsonObjList.allNumber;
- var lendNumber = jsonObjList.badNumber;
- var waitNumber = jsonObjList.checkNumber;
- var normalNumber = jsonObjList.loanNumber;
- var expireNumber = jsonObjList.normalNumber;
- var damageNumber = jsonObjList.timeoutNumber;
- materialchecksave_tableModel.append({
- materialType: materialType,
- materialIcon: materialIcon,
- mainNumber: mainNumber,
- lendNumber: lendNumber,
- waitNumber: waitNumber,
- normalNumber: normalNumber,
- expireNumber: expireNumber,
- damageNumber: damageNumber,
- });
- }
- }
- }
- function image_show(fileUrl)
- {
- if (fileUrl === "")
- {
- materialchecksave_text_sign.visible = true;
- materialchecksave_image_sign.visible = false;
- }
- else
- {
- materialchecksave_text_sign.visible = false;
- materialchecksave_image_sign.visible = true;
- materialchecksave_image_sign.source = fileUrl;
- }
- }
- function submit_check_result()
- {
- // var jsonObjRoot;
- // jsonObjRoot["list"] = materialCheckForm.ret_check_result();
- // var strJson = JSON.stringify(jsonObjRoot);
- // console.log(jsonObjRoot);
- }
- }
- http://192.168.0.10:9191/dev-api/iscs/hardware/material-api/getLastCheckPlanByCabinetCode?cabinetCode=CABINET_006
- http://192.168.0.10:9191/dev-api/iscs/hardware/material-api/getCheckMaterialsByCabinetCode?cabinetCode=CABINET_006&planId=85
|