using DefaultNamespace;
using DefaultNamespace.ProcessMode;
using MotionFramework;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static InterfaceManager;
///
/// 入库单
///
public class WarehouseReceipt : DocumentScript
{
public static WarehouseReceipt Instance;
#region UI
///
/// 入库类型
///
[Header("入库类型")]
public TMP_InputField InInTypeWarehouseWarrant;
///
/// 公司代码/名称
///
[Header("公司代码/名称")]
public TMP_InputField InCompanyCodeNameWarehouseWarrant;
///
/// 工厂代码/工厂名称
///
[Header("工厂代码/工厂名称")]
public TMP_InputField InFactoryCodeNameWarehouseWarrant;
///
/// 移动类型代码/移动类型名称
///
[Header("移动类型代码/移动类型名称")]
public TMP_InputField InTransportationTypeCodeNameWarehouseWarrant;
///
/// 供应商编码/供应商名称
///
[Header("供应商编码/供应商名称")]
public TMP_InputField InSupplierCodeNameWarehouseWarrant;
///
/// 订单号
///
[Header("订单号")]
public TMP_InputField InOrderNumberWarehouseWarrant;
///
/// 凭证输入日期
///
[Header("凭证输入日期")]
public TMP_InputField InVoucherInputDateWarehouseWarrant;
///
/// 合同编号
///
[Header("合同编号")]
public TMP_InputField InContractNumberWarehouseWarrant;
///
/// 物料凭证
///
[Header("物料凭证")]
public TMP_InputField InMaterialVoucherWarehouseWarrant;
///
/// 物料编码
///
[Header("物料编码")]
public TMP_InputField InMaterialCodeWarehouseWarrant;
///
/// 物料描述
///
[Header("物料描述")]
public TMP_InputField InMaterialDescriptionWarehouseWarrant;
///
/// 计量单位
///
[Header("计量单位")]
public TMP_InputField InMeasurementUnitWarehouseWarrant;
///
/// 订单数量
///
[Header("订单数量")]
public TMP_InputField InStockQuantityWarehouseWarrant;
///
/// 实际到货数量
///
[Header("实际到货数量")]
public TMP_InputField InActualArrivalQuantityWarehouseWarrant;
///
/// 单价
///
[Header("单价")]
public TMP_InputField InUnitPriceWarehouseWarrant;
///
/// 总价
///
[Header("总价")]
public TMP_InputField InTotalPriceWarehouseWarrant;
///
/// 库存地点代码
///
[Header("库存地点代码")]
public TMP_InputField InStockLocationCodeWarehouseWarrant;
///
/// 批次号
///
[Header("批次号")]
public TMP_InputField InBatchNumberWarehouseWarrant;
///
/// 打印日期
///
[Header("打印日期")]
public TMP_InputField InPrintDateWarehouseWarrant;
///
/// 库管员
///
[Header("库管员")]
public TMP_InputField InStockKeeperWarehouseWarrant;
///
/// 仓库主管
///
[Header("仓库主管")]
public TMP_InputField InWarehouseManagerWarehouseWarrant;
///
/// 保存按钮
///
[Header("保存按钮")]
public Button btnSaveWarehouseWarrant;
///
/// 保存完毕
///
public TextMeshProUGUI textSaveWarehouseWarrant;
#endregion
private void Awake()
{
Instance = this;
}
void Start()
{
if(btnSaveWarehouseWarrant!= null)
{
btnSaveWarehouseWarrant.onClick.AddListener(() =>
{
List inputList = new List();
inputList.Add(InStockKeeperWarehouseWarrant.text);
inputList.Add(InWarehouseManagerWarehouseWarrant.text);
if(MotionFramework.MotionEngine.GetModule().HandleClick(inputList)){
// 保存成功
Debug.Log("保存成功");
btnSaveWarehouseWarrant.interactable = false;
textSaveWarehouseWarrant.gameObject.SetActive(true);
LoadTriggerNextGuide();
}
});
}
Init();
}
///
/// 初始化
///
private void Init()
{
CombinedClass combinedClass = GameManager.Instance.combinedClass;
if (combinedClass != null)
{
InInTypeWarehouseWarrant.text = combinedClass.storageType;
InFactoryCodeNameWarehouseWarrant.text = combinedClass.FactoryCode + "/"
+ combinedClass.FactoryName;
InTransportationTypeCodeNameWarehouseWarrant.text = combinedClass.TransportationTypeCode + " "
+ combinedClass.TransportationTypeName;
//InSupplierCodeNameWarehouseWarrant.text = combinedClass.SupplierCode
//+ combinedClass.SupplierName;
InSupplierCodeNameWarehouseWarrant.text = ModerController.Instance.checkGoods[0].Manufacturer.text;
InOrderNumberWarehouseWarrant.text = combinedClass.OrderNumber;
InVoucherInputDateWarehouseWarrant.text = combinedClass.DeliveryDate;
InContractNumberWarehouseWarrant.text = combinedClass.ContractNumber;
InMaterialVoucherWarehouseWarrant.text = combinedClass.materialVoucherCreator;
InMaterialCodeWarehouseWarrant.text = MotionEngine.GetModule().GetTaskBookValueByMapping("物料编码");
InMaterialDescriptionWarehouseWarrant.text = MotionEngine.GetModule().GetTaskBookValueByMapping("物料描述");
InMeasurementUnitWarehouseWarrant.text = GameManager.Instance.unit;
InStockQuantityWarehouseWarrant.text = GameManager.Instance.marteialnumber.ToString();
InActualArrivalQuantityWarehouseWarrant.text = GameManager.Instance.marteialnumber.ToString();
InUnitPriceWarehouseWarrant.text = GameManager.Instance.pice;
InTotalPriceWarehouseWarrant.text = (float.Parse(GameManager.Instance.marteialnumber.ToString()) * float.Parse(GameManager.Instance.pice)).ToString();
InStockLocationCodeWarehouseWarrant.text = "HDA1";
InBatchNumberWarehouseWarrant.text = MotionEngine.GetModule().GetTaskBookValueByMapping("批次");
InPrintDateWarehouseWarrant.text = "2025.03.04";
}
}
}