Commit d110c119 by 陶然

优化

parent d35172c8
......@@ -9,6 +9,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Timers;
......@@ -62,6 +63,8 @@ namespace Kivii.Client.SamplePackages
btnLogin.Enabled = true;
btnLogout.Enabled = false;
btnScanRfid.Enabled = false;
tbScanSample.Enabled = false;
tbScanSample.Text = "";
btnClearCurrentPackage.Enabled = false;
tbCurrentLocation.Text = "";
tbCurrentDepartment.Text = "";
......@@ -162,7 +165,7 @@ namespace Kivii.Client.SamplePackages
request.OwnerKvid = _userInfo.DepartmentKvid;
//request.OwnerKvid = Guid.Parse("D4CE47D2-5FC8-479D-A0CA-BACDF1A891BF");//色牢度组
//request.OwnerKvid = Guid.Parse("9D026818-6E78-40F8-A715-2887F96F34DC");//纤检组
//request.OwnerKvid = Guid.Parse("208C24FB-1443-4B9E-9886-02ED3B9A8F45");//安全组
request.OwnerKvid = Guid.Parse("208C24FB-1443-4B9E-9886-02ED3B9A8F45");//安全组
//request.OwnerKvid = Guid.Parse("7CF9CF7B-19F5-4A1A-A94C-5BC21EA8ED76");//纤维含量组
//request.OwnerKvid = Guid.Parse("BB355D5A-9D4E-4337-B577-7BB7A1625F68");//羽绒组
var task = _client.PostAsync(request);
......@@ -220,11 +223,12 @@ namespace Kivii.Client.SamplePackages
});
}
private void samplePrepackaging(string tid)
private void samplePrepackaging(string tid, string bizId = null)
{
if (tid.IsNullOrEmpty()) return;
if (tid.IsNullOrEmpty() && bizId.IsNullOrEmpty()) return;
var request = new SamplePrePackaging();
request.Tid = tid;
if(!tid.IsNullOrEmpty())request.Tid = tid;
if(!bizId.IsNullOrEmpty())request.BizId = bizId;
request.OwnerKvid = _currentLocation.OwnerKvid;
try
{
......@@ -350,6 +354,8 @@ namespace Kivii.Client.SamplePackages
btnClearCurrentPackage.Enabled = _currentPackage != null;
cbSetCurrentPackageNode.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
btnScanRfid.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
tbScanSample.Enabled = _currentPackage.Status == (int)PackageStatus.Empty || _currentPackage.Status == (int)PackageStatus.Full;
tbScanSample.Text = "";
if (_currentPackage.Status == (int)PackageStatus.Full || _currentPackage.Status == (int)PackageStatus.Inbound)
{
querySampleInPackaged();
......@@ -360,6 +366,7 @@ namespace Kivii.Client.SamplePackages
return;
}
cbSetCurrentPackageNode.SelectedIndex = 0;
Thread.Sleep(200);
btnScanRfid_Click(null, null);
});
task.Error(err =>
......@@ -371,6 +378,9 @@ namespace Kivii.Client.SamplePackages
cbSetCurrentPackageNode.SelectedItem = null;
cbSetCurrentPackageNode.Enabled = false;
btnScanRfid.Enabled = false;
tbScanSample.Enabled = false;
tbScanSample.Text = "";
MessageBox.Show(err.Message, "箱号设置");
});
}
......@@ -507,6 +517,9 @@ namespace Kivii.Client.SamplePackages
cbSetCurrentPackageNode.SelectedItem = null;
cbSetCurrentPackageNode.Enabled = false;
btnScanRfid.Enabled = false;
tbScanSample.Enabled = false;
tbScanSample.Text = "";
dgvSamples.DataSource = null;
}
......@@ -621,5 +634,33 @@ namespace Kivii.Client.SamplePackages
if (currentRowSample == null) return;
sampleUnpackaging(currentRowSample);
}
private void tbScanSample_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (_client == null)
{
MessageBox.Show("请先登录.");
return;
}
if (_currentLocation == null)
{
MessageBox.Show("未获取当前位置.");
return;
}
if (_currentPackage == null)
{
MessageBox.Show("未获取当前箱号.");
return;
}
if (_currentPackage.Status == (int)PackageStatus.Inbound)
{
MessageBox.Show("当前箱子已入库,无法继续操作!");
return;
}
samplePrepackaging(null, tbScanSample.Text);
}
}
}
}
......@@ -32,6 +32,7 @@ namespace Kivii.Samples.Transforms
public class SamplePrePackaging:IReturn<RestfulExecutionResponse<Sample>>
{
public string Tid { get; set; }
public string BizId { get; set; }
public Guid OwnerKvid { get; set; }//要打包的样品的所属信息
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment