客户等记及业务日志系统2

时间:2022-05-31 17:14:30
业务日志稍微简单些,因为不用修改日志的,只需要写入和浏览,目前只实现写入数据库先
AddTicket.mxml+callInfo.php+ticketInfo(表)

AddTicket.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx=" http://www.adobe.com/2006/mxml " layout="absolute" width="700" height="500">
<mx:Panel x="0" y="0" width="700" height="500" layout="absolute" title="添加工单">
  <mx:Text x="30" y="20" text="业务单" width="78"/>
  
  <mx:Label x="240" y="50" text="来电人" width="35"/>
  <mx:TextInput x="283" y="48" width="91" id="callerName"/>
  
  <mx:Label x="35" y="48" text="来电号码" />
  <mx:TextInput x="92" y="48" width="91" id="callNum"/>
  
  <mx:Label x="405" y="50" text="来电地址" id="callAddress"/>
  <mx:TextInput x="458" y="46" width="161"/>
  
  <mx:Label x="228" y="90" text="受理日期"  width="48"/>
  <mx:DateField x="284" y="88" id="callDate"/>
    
  <!--<mx:Label x="240" y="94" text="受理时间" />
  <mx:NumericStepper x="293" y="92" width="91" height="20" id="callTime"/>
  -->
    
  <mx:Label x="35" y="90" text="受理结果"/>
  <mx:TextInput x="92" y="88" width="91" id="dealResult"/>
  
  <mx:Label x="35" y="140" text="申请人"/>
  <mx:TextInput x="92" y="138" width="91" id="callForPerson"/>
  
  <mx:Label x="245" y="140" text="部门科室"/>
  <mx:TextInput x="302" y="138" width="91" id="callFordepartment"/>
  
  <mx:Label x="471" y="140" text="联系电话"/>
  <mx:TextInput x="528" y="138" width="91" id="callForNum"/>
  <mx:Label x="35" y="181" text="受理内容" />
  <mx:TextInput x="92" y="179" width="527" height="43" id="callItem"/>
  
  <mx:Label x="35" y="232" text="级别"/>
  <mx:TextInput x="92" y="230" width="65" id="priority"/>
  
  <mx:Label x="245" y="232" text="预约日期"/>
  <mx:TextInput x="302" y="230" width="91" id="bookDate"/>
  
  <mx:Label x="471" y="232" text="预约时间"/>
  <mx:TextInput x="528" y="230" width="91" id="bookTime"/>
  
  <mx:Label x="35" y="260" text="备注"/>
  <mx:TextInput x="92" y="258" width="527" height="43" id="status"/>
  
  <mx:Label x="35" y="320" text="办理部门"/>
  <mx:TextInput x="92" y="318" width="91" id="dealDepartment"/>
  
  <mx:Label x="245" y="320" text="坐席号"/>
  <mx:TextInput x="302" y="318" width="91" id="agentNum"/>
  
  <mx:Label x="471" y="320" text="坐席姓名"/>
  <mx:TextInput x="528" y="318" width="91" id="agentName"/>
  
  <mx:Label x="35" y="350" text="出单日期"/>
  <mx:DateField x="93" y="348" id="outTicketDate"/>
  <mx:Label x="245" y="350" text="出单时间"/>
  <mx:TextInput x="302" y="348" width="91" height="20" id="outTicketTime"/>
  
  <mx:Label x="471" y="348" text="出单状态"/>
  <mx:TextInput x="528" y="346" width="91" id="outTicketState"/>
  
<mx:Button x="367" y="401" label="添加" width="70" click="addTicket()"/>
  <mx:Button x="500" y="401" label="取消" width="70" click="cancelTicket()"/>
</mx:Panel>
<mx:Script>
  <![CDATA[
  import mx.collections.ArrayCollection;
        import com.adobe.serialization.json.JSON;
        import mx.rpc.events.ResultEvent;
        import flash.net.*;
      private var callInfo:Array=new Array(25);
   function addTicket():void
   {
    callInfo[0]=callerName.text;
    callInfo[1]=callNum.text;
    callInfo[2]=callAddress.text;
        
    callInfo[3]=callDate.text;    
    callInfo[4]=dealResult.text;  
    callInfo[5]=callForPerson.text;
    callInfo[6]=callFordepartment.text;
    callInfo[7]=callForNum.text;
    callInfo[8]=callItem.text;
    
    callInfo[9]=priority.text;
    callInfo[10]=bookDate.text;
    callInfo[11]=bookTime.text;
    callInfo[12]=status.text;
    
    callInfo[13]=dealDepartment.text;
    callInfo[14]=agentNum.text;
    callInfo[15]=agentName.text;
    callInfo[16]=outTicketDate.text;
    callInfo[17]=outTicketTime.text;
    callInfo[18]=outTicketState.text;
    sendPHPData();
   }
 function sendPHPData():void
   {
    var objSend:Object=new Object();
    var dataString:String=JSON.encode(callInfo);
    dataString=escape(dataString);
       objSend.js;
          sendData.send(objSend);
   }
   function callInform(event:ResultEvent):void
   {
    var backInfo:String=String(event.result);
    /*if(!backInfo=="fail"){
    
     mx.controls.Alert.show("添加工单成功")
    }
    else{
     mx.controls.Alert.show("添加失败");
    }*/
    mx.controls.Alert.show(backInfo+"!");
   }
   function cancelTicket():void
   {
    //Close module or switch to another Module
   }
  
  ]]>
</mx:Script>
<mx:HTTPService id="sendData"
    url=" http://localhost/callInfo.php "
    useProxy="false" method="GET"
    resultFormat="text" result="callInform(event)">
    <mx:request xmlns="">
       <getTutorials>"true"</getTutorials>
     </mx:request>
</mx:HTTPService>
<!--本实例的Application测试可以参考JustForTest->ssss.mxml-->
</mx:Module>