fqc
lu
2025-05-06 437425784b7612e10d4a54bd64905c508347514d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
 
 
namespace Gs.DevApp.DevFrm.QC
{
    public partial class MesQcExceptionalShow : DevExpress.XtraEditors.XtraForm
    {
 
        string strGuid = "";
        string _webServiceName = "MesQcExceptionalManager/";
        public MesQcExceptionalShow(string _strGuid)
        {
            InitializeComponent();
            this.strGuid = _strGuid;
            btnQuery.Click += BtnQuery_Click;
            btnEsc.Click += BtnEsc_Click;
        }
 
        private void BtnEsc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            _toolCk(1);
        }
 
        /// <summary>
        /// 工具条事件
        /// </summary>
        /// <param name="inFieldValue"></param>
        /// <summary>
        /// 
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolCk(int _inFieldValue)
        {
 
            if (txt_freceQty.SelectedIndex <= 0)
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择判定结果!");
                txt_freceQty.Focus();
                return;
            }
            if (txt_freceQty.SelectedIndex == 1)
            {
                if ((txt_fmrmode.SelectedIndex > 0) || txt_fngHandle.SelectedIndex > 0)
                {
                    Gs.DevApp.ToolBox.MsgHelper.Warning("你判定了合格,就不能再选择其它处理方式了!");
                    txt_fmrmode.Focus();
                    return;
                }
            }
            else
            {
                //当选择不合格时,要填写原因
                if (txt_freceQty.SelectedIndex == 2)
                {
                    if ((txt_fngHandle.SelectedIndex <= 0))
                    {
                        Gs.DevApp.ToolBox.MsgHelper.Warning("请选择处理结果!");
                        txt_fngHandle.Focus();
                        return;
                    }
                    if (txt_fngHandle.SelectedIndex == 1)
                    {
                        if ((txt_fmrmode.SelectedIndex <= 0))
                        {
                            Gs.DevApp.ToolBox.MsgHelper.Warning("请选择退料方式!");
                            txt_fmrmode.Focus();
                            return;
                        }
                    }
                    else
                    {
                        if ((txt_fmrmode.SelectedIndex > 0))
                        {
                            Gs.DevApp.ToolBox.MsgHelper.Warning("你选择了特采使用,就不能再选择退料方式了!");
                            txt_fmrmode.Focus();
                            return;
                        }
                    }
                }
            }
 
            string _fmrmode = txt_fmrmode.SelectedIndex > 0 ? txt_fmrmode.Text.Trim() : "";
            string _freceQty = txt_freceQty.SelectedIndex > 0 ? txt_freceQty.Text.Trim() : "";
            string _fngHandle = txt_fngHandle.SelectedIndex > 0 ? txt_fngHandle.Text.Trim() : "";
            var _obj = new
            {
                guid = strGuid,
                inFieldValue = _inFieldValue,
                gs001 = _freceQty,
                gs002 = _fngHandle,
                gs003 = _fmrmode,
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelSubmit", JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = "" });
                    Close();
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
 
        /// <summary>
        ///     选择后的回调事件
        /// </summary>
        public event EventHandler<UpdateParentEventArgs> UpdateParent;
 
    }
}