| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- import QtQuick
- import QtQuick.Layouts
- import QtQuick.Controls
- Item {
- id: materialexceptionfinish
- x: 290
- y: 130
- width: 1600
- height: 920
- // 主体区域
- Rectangle {
- id: materialexceptionfinish_main
- x: 0
- y: 0
- width: parent.width;
- height: parent.height * 0.88
- color: "#272b7ae9"
- radius: 10
- Rectangle {
- x: 20
- y: 20
- width: 1560
- height: 400
- color: "#1a3782"
- radius: 10
- Rectangle {
- x: 5
- y: 5
- width: 250
- height: 52
- color: "#ffffff"
- radius: 20
- Text {
- anchors.centerIn: parent
- font.pixelSize: 25
- // font.bold: true
- color: "#ff0000"
- text: "异常类型:物资错放"
- }
- }
- Rectangle {
- x: 5
- y: 60
- width: 412
- height: 50
- color: "#1a3782"
- Text {
- horizontalAlignment: Text.AlignLeft
- verticalAlignment: Text.AlignVCenter
- anchors.fill: parent
- font.pixelSize: 20
- color: "#ffffff"
- text: "以下物资不属于该柜子,请取出!"
- }
- }
- GridView {
- x: 25
- y: 100
- width: parent.width - 50
- height: parent.height - 120
- cellWidth: 250
- cellHeight: 350
- // model: materialexception_modelmaterialexception
- delegate: Rectangle{
- width: 250
- height: 350
- color: "#00ffffff"
- Rectangle {
- x: 25
- y: 25
- width: 200
- height: 200
- color: "#8fffffff"
- Image {
- x: 0
- y: 0
- width: 200
- height: 200
- visible: true
- source: model.materialsTypePicture
- fillMode: Image.PreserveAspectFit
- }
- // Text {
- // x: 0
- // y: 185
- // width: parent.width
- // height: 50
- // visible: true
- // text: model.materialsName
- // font.pixelSize: 30
- // horizontalAlignment: Text.AlignHCenter
- // verticalAlignment: Text.AlignVCenter
- // color: "#ffffff"
- // }
- Text {
- x: 0
- y: 200
- width: parent.width
- height: 25
- visible: true
- text: model.materialsRfid
- font.pixelSize: 12
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: "#ffffff"
- }
- Rectangle {
- x: 25
- y: 125
- width: 150
- height: 50
- color: {
- if (model.status === "0") return "#00ff00"; // 正常 - 绿色
- if (model.status === "1") return "#ff0000"; // 损坏 - 红色
- if (model.status === "2") return "#ff9900"; // 过期 - 橙色
- if (model.status === "3") return "#ff9900"; // 放错柜子 - 橙色
- return "gray"; // 默认颜色
- }
- visible: {
- return model.status !== "0";
- }
- Text {
- anchors.centerIn: parent
- // text: "待还"
- text:{
- if (model.status === "0") return "正常";
- if (model.status === "1") return "损坏";
- if (model.status === "2") return "过期";
- if (model.status === "3") return "放错柜子";
- return "未知状态"; // 默认值
- }
- font.pixelSize: 30
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: "#ffffff"
- }
- }
- }
- }
- }
- }
- }
- // 状态栏
- Rectangle {
- id: materialexceptionfinish_stat
- x: 0
- y: parent.height * 0.88
- width: parent.width;
- height: parent.height * 0.12
- color: "#00ffffff"
- radius: 10
- // 右侧布局
- Row {
- anchors.right: parent.right // 右对齐
- spacing: 10
- // 开柜按钮
- Button {
- id: materialexceptionfinish_btn_return
- y: 25
- width: 192
- height: 75
- background: Rectangle {
- color: "#ff0000"
- radius: 10
- }
- text: qsTr("关闭")
- font.pixelSize: 30
- palette.buttonText: "white"
- Connections {
- target: materialexceptionfinish_btn_return
- onClicked: {
- materialexceptionfinish.visible = false;
- saterialSelModel.visible = true;
- }
- }
- }
- }
- }
- }
|