120 lines
3.0 KiB
C#
120 lines
3.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.Experimental.GraphView;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Operationprocess : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 违约类型操作页面
|
|
/// </summary>
|
|
public RectTransform operationpanel;
|
|
/// <summary>
|
|
/// 违约类型
|
|
/// </summary>
|
|
public Dropdown typeofbreach;
|
|
/// <summary>
|
|
/// 接收违约类型下拉框
|
|
/// </summary>
|
|
public string strtext;
|
|
/// <summary>
|
|
/// 上报按钮
|
|
/// </summary>
|
|
public Button report;
|
|
/// <summary>
|
|
/// 工单编号页面
|
|
/// </summary>
|
|
public RectTransform workordernumber;
|
|
/// <summary>
|
|
/// 工作看板按钮
|
|
/// </summary>
|
|
public Button workpanelbtn;
|
|
/// <summary>
|
|
/// 代办工单页面
|
|
/// </summary>
|
|
public RectTransform agencyworkorder;
|
|
/// <summary>
|
|
/// 代办工单按钮
|
|
/// </summary>
|
|
public Button workorderbutton;
|
|
/// <summary>
|
|
/// 操作完成颜色变深
|
|
/// </summary>
|
|
private Sprite procedure;
|
|
/// <summary>
|
|
/// 操作步骤颜色变深
|
|
/// </summary>
|
|
public List<Image> chartletlist = new List<Image>();
|
|
/// <summary>
|
|
/// 工单输入编号
|
|
/// </summary>
|
|
public RectTransform incomingworkorder;
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button inquirebutton;
|
|
/// <summary>
|
|
/// 违约特工面板
|
|
/// </summary>
|
|
public RectTransform breachofcontract;
|
|
void Start()
|
|
{
|
|
procedure = Resources.Load<Sprite>("UIpanel/procedure");
|
|
typeofbreach.onValueChanged.AddListener(delegate
|
|
{
|
|
OnDropdownValueChanged(typeofbreach);
|
|
});
|
|
report.onClick.AddListener(Reportoperation);
|
|
workpanelbtn.onClick.AddListener(() =>
|
|
{
|
|
workordernumber.gameObject.SetActive(false);
|
|
agencyworkorder.gameObject.SetActive(true);
|
|
});
|
|
workorderbutton.onClick.AddListener(() =>
|
|
{
|
|
agencyworkorder.gameObject.SetActive(false);
|
|
incomingworkorder.gameObject.SetActive(true);
|
|
chartletlist[1].sprite = procedure;
|
|
});
|
|
inquirebutton.onClick.AddListener(() =>
|
|
{
|
|
incomingworkorder.gameObject.SetActive(false);
|
|
breachofcontract.gameObject.SetActive(true);
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 判断违约类型方法
|
|
/// </summary>
|
|
private void Reportoperation()
|
|
{
|
|
Debug.Log("进来了");
|
|
if (strtext.Length > 0)
|
|
{
|
|
if (strtext.Length>1)
|
|
{
|
|
Debug.Log("上报成功");
|
|
operationpanel.gameObject.SetActive(false);
|
|
workordernumber.gameObject.SetActive(true);
|
|
chartletlist[0].sprite = procedure;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("请选择违约类型");
|
|
}
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void OnDropdownValueChanged(Dropdown dropdown)
|
|
{
|
|
Debug.Log("调用了");
|
|
strtext = dropdown.options[dropdown.value].text;
|
|
}
|
|
}
|