Procházet zdrojové kódy

医保目录下载菜单单条新增功能增加,最小包装转换数、收费项目类别、目录类别。

837390164@qq.com před 6 dny
rodič
revize
66211ae02c

+ 17 - 5
HuBeiMI/FormSetter/GridViewSetterBase.cs

@@ -10,7 +10,7 @@ using System.Windows.Forms;
 
 namespace PTMedicalInsurance.FormSetter
 {
-    class GridViewSetterBase
+    public class GridViewSetterBase
     {
         /// <summary>
         /// 动态增加datagridview列
@@ -27,13 +27,12 @@ namespace PTMedicalInsurance.FormSetter
             newColumn.Name = dataPropertyName;
             dgv.Columns.Add(newColumn);
         }
-
         public void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, string sqlStr)
         {
-            SetDBLKCombox(ref dblcbx,GetDBLKComboxTable(sqlStr));
+            SetDBLKCombox(ref dblcbx, GetDBLKComboxTable(sqlStr));
         }
 
-        public void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx,DataTable dt)
+        public void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, DataTable dt)
         {
             if (dt == null) return;
 
@@ -50,7 +49,6 @@ namespace PTMedicalInsurance.FormSetter
             dblcbx.DataGridView.Columns[0].Width = 100;
             dblcbx.DataGridView.Columns[1].Width = 200;
         }
-
         public DataTable GetDBLKComboxTable(string sqlStr)
         {
             InvokeHelper invoker = new InvokeHelper();
@@ -71,5 +69,19 @@ namespace PTMedicalInsurance.FormSetter
             //dt.Columns[2].ColumnName = "拼音查找码";
             return dt;
         }
+
+        public void SetCombox(ref System.Windows.Forms.ComboBox cbx, string sqlStr, string displayMember = "Name", string valueMember = "Code")
+        {
+            try
+            {
+                cbx.DataSource = GetDBLKComboxTable(sqlStr);
+                cbx.DisplayMember = displayMember;
+                cbx.ValueMember = valueMember;
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show($"SetCombox控件{cbx.Name}设置异常:{ex.Message}");
+            }
+        }
     }
 }

+ 49 - 57
HuBeiMI/Forms/AddSignleDirectory.cs

@@ -1,4 +1,6 @@
 using Newtonsoft.Json.Linq;
+using PTMedicalInsurance.FormSetter;
+using PTMedicalInsurance.Variables;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -17,6 +19,7 @@ namespace PTMedicalInsurance
     {
         private int direcType ;
         public JObject joPamam = new JObject();
+        private GridViewSetterBase grdSetterBase = new GridViewSetterBase();
         public AddSingleDirectory()
         {
             InitializeComponent();
@@ -40,11 +43,6 @@ namespace PTMedicalInsurance
 
         }
 
-        private void pnlClient_Paint(object sender, PaintEventArgs e)
-        {
-
-        }
-
         private void btnNo_Click(object sender, EventArgs e)
         {
             DialogResult = DialogResult.Cancel;
@@ -76,7 +74,6 @@ namespace PTMedicalInsurance
             }
         }
 
-
         private void initForm()
         {
             setTextBoxEnabled(true);
@@ -93,18 +90,39 @@ namespace PTMedicalInsurance
                         break;
                     }
             }
+
+            string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
+
+            string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr  "
+                          + " WHERE  A.InsuCode = 'list_type'" + sqlCondition;
+
+            grdSetterBase.SetCombox(ref cbxListType, sqlStr);
+
+            //med_chrgitm_type
+
+            sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr  "
+                         + " WHERE  A.InsuCode = 'med_chrgitm_type'" + sqlCondition;
+
+            grdSetterBase.SetCombox(ref cbxChargeItemType, sqlStr);
+        }
+        
+
+        private void SetSelectValue(System.Windows.Forms.ComboBox cbx, string targetName)
+        {
+            for (int i = 0; i < cbx.Items.Count; i++)
+            {
+                // 假设数据源是 DataTable,绑定的是 DataRowView
+                if (cbx.Items[i] is DataRowView rowView)
+                {
+                    if (rowView["Name"].ToString() == targetName)
+                    {
+                        cbx.SelectedIndex = i;
+                        break;
+                    }
+                }
+            }
         }
-        //private void setValue(DataRow dr)
-        //{
-        //    switch (direcType)
-        //    {
-        //        case 0:
-        //            {
-        //                setDrugInfo(dr);
-        //                break;
-        //            }
-        //    }
-        //}
+
         private void setValue(DataRow dr)
         {
             try
@@ -134,10 +152,15 @@ namespace PTMedicalInsurance
                 cbSpecialFlag.Checked = getFlag(dr["SpecialFlag"].ToString());
                 cbLimitFlag.Checked = getFlag(dr["LimitFlag"].ToString());
                 cbValidFlag.Checked = getFlag(dr["ValidFlag"].ToString());
+                cbChildFlag.Checked = getFlag(dr["CumulativeNegativeBurdenFlag"].ToString());
                 tbUniqueRecordNO.Text = dr["UniqueRecordNO"].ToString();
                 tbNationalCode.Text = dr["NationalCode"].ToString();
                 tbNationalName.Text = dr["NationalName"].ToString();
                 tbManufacturers.Text = dr["Manufacturers"].ToString();
+                tbMinPackagingQuantity.Text = dr["MinPackagingQuantity"].ToString();
+                cbxListType.SelectedValue = dr["ListType"].ToString();
+                //cbxChargeItemType.SelectedValue = dr["ChargeItemType"].ToString();
+                SetSelectValue(cbxChargeItemType, dr["ChargeItemType"].ToString());
                 if (dr["ChargeItemLevel"].ToString() != "")
                 {
                     cbxChargeItemLevel.SelectedIndex = int.Parse(dr["ChargeItemLevel"].ToString()) - 1;
@@ -146,8 +169,8 @@ namespace PTMedicalInsurance
                 {
                     cbxChargeItemLevel.Text = dr["ChargeItemLevel"].ToString();
                 }
-                
-                tbCompany.Text = dr["Company"].ToString();
+
+                //tbCompany.Text = dr["Company"].ToString();
             }
             catch (Exception ex)
             {
@@ -158,7 +181,6 @@ namespace PTMedicalInsurance
         {
             string hisTypeName = cbxDirecType.Text;
 
-
             string pym = tbPinyinSearchCode.Text;
             if (tbPinyinSearchCode.Text == "")
             {
@@ -171,8 +193,6 @@ namespace PTMedicalInsurance
                 ChargeItemLevel = "0" + (cbxChargeItemLevel.SelectedIndex + 1).ToString();
             }
 
-
-
             joPamam.Add("Code",tbCode.Text);
             joPamam.Add("Name", tbName.Text);
             joPamam.Add("HisType",direcType + 1);
@@ -210,7 +230,13 @@ namespace PTMedicalInsurance
             joPamam.Add("UpdateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             joPamam.Add("ChargeItemLevel", ChargeItemLevel);
             joPamam.Add("Company", tbCompany.Text);
+            joPamam.Add("CumulativeNegativeBurdenFlag", Convert.ToInt32(cbChildFlag.Checked));
+
+            joPamam.Add("MinPackagingQuantity", tbMinPackagingQuantity.Text);
+            joPamam.Add("ChargeItemType", cbxChargeItemType.SelectedValue?.ToString());
+            joPamam.Add("ListType", cbxListType.SelectedValue?.ToString());
         }
+
         private void initDrugForm()
         {
             lbApprovalNO.ForeColor = Color.Red;
@@ -218,41 +244,7 @@ namespace PTMedicalInsurance
             lbManufacturers.ForeColor = Color.Red;
             lbUnitOfPackag.ForeColor = Color.Red;
             lbCompany.ForeColor = Color.Red;
-        }
-
-        private void initMedicalServiceForm()
-        {
-
-           
-        }
-        private void initMaterialsForm()
-        {
-
-        }
-
-        private void initDiagnoseForm()
-        {
-
-        }
-        private void initDictionaryForm()
-        {
-
-        }
-
-        private void textBox23_TextChanged(object sender, EventArgs e)
-        {
-
-        }
-
-        private void lbUniqueRecordNO_Click(object sender, EventArgs e)
-        {
-
-        }
-
-        private void tbUniqueRecordNO_TextChanged(object sender, EventArgs e)
-        {
-
-        }
+        }     
 
         private void btnYes_Click(object sender, EventArgs e)
         {

+ 92 - 9
HuBeiMI/Forms/AddSignleDirectory.designer.cs

@@ -29,6 +29,7 @@
         private void InitializeComponent()
         {
             this.pnlTop = new System.Windows.Forms.Panel();
+            this.cbChildFlag = new System.Windows.Forms.CheckBox();
             this.cbValidFlag = new System.Windows.Forms.CheckBox();
             this.cbLimitFlag = new System.Windows.Forms.CheckBox();
             this.cbSpecialFlag = new System.Windows.Forms.CheckBox();
@@ -82,6 +83,12 @@
             this.lbStartDate = new System.Windows.Forms.Label();
             this.tbStartDate = new System.Windows.Forms.TextBox();
             this.pnlClient = new System.Windows.Forms.Panel();
+            this.cbxListType = new System.Windows.Forms.ComboBox();
+            this.cbxChargeItemType = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tbMinPackagingQuantity = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
             this.cbxChargeItemLevel = new System.Windows.Forms.ComboBox();
             this.tbCompany = new System.Windows.Forms.TextBox();
             this.lbCompany = new System.Windows.Forms.Label();
@@ -111,6 +118,7 @@
             // pnlTop
             // 
             this.pnlTop.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.pnlTop.Controls.Add(this.cbChildFlag);
             this.pnlTop.Controls.Add(this.cbValidFlag);
             this.pnlTop.Controls.Add(this.cbLimitFlag);
             this.pnlTop.Controls.Add(this.cbSpecialFlag);
@@ -124,6 +132,17 @@
             this.pnlTop.Size = new System.Drawing.Size(1424, 51);
             this.pnlTop.TabIndex = 0;
             // 
+            // cbChildFlag
+            // 
+            this.cbChildFlag.AutoSize = true;
+            this.cbChildFlag.ForeColor = System.Drawing.Color.Red;
+            this.cbChildFlag.Location = new System.Drawing.Point(891, 15);
+            this.cbChildFlag.Name = "cbChildFlag";
+            this.cbChildFlag.Size = new System.Drawing.Size(116, 19);
+            this.cbChildFlag.TabIndex = 80;
+            this.cbChildFlag.Text = "儿童用药标志";
+            this.cbChildFlag.UseVisualStyleBackColor = true;
+            // 
             // cbValidFlag
             // 
             this.cbValidFlag.AutoSize = true;
@@ -215,24 +234,24 @@
             // btnNo
             // 
             this.btnNo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnNo.Location = new System.Drawing.Point(1254, 21);
+            this.btnNo.Location = new System.Drawing.Point(1277, 10);
             this.btnNo.Margin = new System.Windows.Forms.Padding(4);
             this.btnNo.Name = "btnNo";
-            this.btnNo.Size = new System.Drawing.Size(127, 29);
+            this.btnNo.Size = new System.Drawing.Size(127, 43);
             this.btnNo.TabIndex = 1;
-            this.btnNo.Text = "放弃";
+            this.btnNo.Text = "放    弃";
             this.btnNo.UseVisualStyleBackColor = true;
             this.btnNo.Click += new System.EventHandler(this.btnNo_Click);
             // 
             // btnYes
             // 
             this.btnYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnYes.Location = new System.Drawing.Point(1099, 21);
+            this.btnYes.Location = new System.Drawing.Point(1122, 10);
             this.btnYes.Margin = new System.Windows.Forms.Padding(4);
             this.btnYes.Name = "btnYes";
-            this.btnYes.Size = new System.Drawing.Size(127, 29);
+            this.btnYes.Size = new System.Drawing.Size(127, 43);
             this.btnYes.TabIndex = 0;
-            this.btnYes.Text = "确定";
+            this.btnYes.Text = "确    定";
             this.btnYes.UseVisualStyleBackColor = true;
             this.btnYes.Click += new System.EventHandler(this.btnYes_Click);
             // 
@@ -446,7 +465,6 @@
             this.lbUniqueRecordNO.Size = new System.Drawing.Size(82, 15);
             this.lbUniqueRecordNO.TabIndex = 40;
             this.lbUniqueRecordNO.Text = "唯一记录号";
-            this.lbUniqueRecordNO.Click += new System.EventHandler(this.lbUniqueRecordNO_Click);
             // 
             // tbUniqueRecordNO
             // 
@@ -455,7 +473,6 @@
             this.tbUniqueRecordNO.Name = "tbUniqueRecordNO";
             this.tbUniqueRecordNO.Size = new System.Drawing.Size(225, 25);
             this.tbUniqueRecordNO.TabIndex = 41;
-            this.tbUniqueRecordNO.TextChanged += new System.EventHandler(this.tbUniqueRecordNO_TextChanged);
             // 
             // lbManufacturers
             // 
@@ -631,6 +648,12 @@
             // 
             // pnlClient
             // 
+            this.pnlClient.Controls.Add(this.cbxListType);
+            this.pnlClient.Controls.Add(this.cbxChargeItemType);
+            this.pnlClient.Controls.Add(this.label3);
+            this.pnlClient.Controls.Add(this.label2);
+            this.pnlClient.Controls.Add(this.tbMinPackagingQuantity);
+            this.pnlClient.Controls.Add(this.label1);
             this.pnlClient.Controls.Add(this.cbxChargeItemLevel);
             this.pnlClient.Controls.Add(this.tbCompany);
             this.pnlClient.Controls.Add(this.lbCompany);
@@ -688,7 +711,60 @@
             this.pnlClient.Name = "pnlClient";
             this.pnlClient.Size = new System.Drawing.Size(1424, 553);
             this.pnlClient.TabIndex = 1;
-            this.pnlClient.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlClient_Paint);
+            // 
+            // cbxListType
+            // 
+            this.cbxListType.FormattingEnabled = true;
+            this.cbxListType.Location = new System.Drawing.Point(797, 240);
+            this.cbxListType.Name = "cbxListType";
+            this.cbxListType.Size = new System.Drawing.Size(225, 23);
+            this.cbxListType.TabIndex = 95;
+            // 
+            // cbxChargeItemType
+            // 
+            this.cbxChargeItemType.FormattingEnabled = true;
+            this.cbxChargeItemType.Location = new System.Drawing.Point(453, 240);
+            this.cbxChargeItemType.Name = "cbxChargeItemType";
+            this.cbxChargeItemType.Size = new System.Drawing.Size(225, 23);
+            this.cbxChargeItemType.TabIndex = 94;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(698, 244);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(67, 15);
+            this.label3.TabIndex = 93;
+            this.label3.Text = "目录类别";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(354, 244);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(97, 15);
+            this.label2.TabIndex = 92;
+            this.label2.Text = "收费项目类别";
+            // 
+            // tbMinPackagingQuantity
+            // 
+            this.tbMinPackagingQuantity.Location = new System.Drawing.Point(152, 240);
+            this.tbMinPackagingQuantity.Margin = new System.Windows.Forms.Padding(4);
+            this.tbMinPackagingQuantity.Name = "tbMinPackagingQuantity";
+            this.tbMinPackagingQuantity.Size = new System.Drawing.Size(179, 25);
+            this.tbMinPackagingQuantity.TabIndex = 91;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(32, 244);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(112, 15);
+            this.label1.TabIndex = 90;
+            this.label1.Text = "最小包装转换数";
             // 
             // cbxChargeItemLevel
             // 
@@ -938,5 +1014,12 @@
         private System.Windows.Forms.TextBox tbCompany;
         private System.Windows.Forms.Label lbCompany;
         private System.Windows.Forms.ComboBox cbxChargeItemLevel;
+        private System.Windows.Forms.CheckBox cbChildFlag;
+        private System.Windows.Forms.ComboBox cbxListType;
+        private System.Windows.Forms.ComboBox cbxChargeItemType;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tbMinPackagingQuantity;
+        private System.Windows.Forms.Label label1;
     }
 }